From the course: Design the Web: Styling a Table
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Targeting all TH and TD tags - phpMyAdmin Tutorial
From the course: Design the Web: Styling a Table
Targeting all TH and TD tags
- [Voiceover] Now we're going to target the table-header elements, and the table-data elements. Now in the browser, you'll notice the top row is showing the type in bold, and is centered. If we take a look at the HTML, we'll see here that this is inside of a table-header element, and we have these th elements here, which stand for table-header, where we see Planet Type, distance from the sun and moons. Having these inside a th, in most browsers will make these bold, and center these elements, as opposed to the content down here, where we see Mercury, for example, which is inside of td elements. I'll come back up here, turn my preview back on. Now over in my CSS file, what we're going to do first is target all of the th's and td elements, just to make some of the styling more consistent. Let's come up here and copy the table#planets. I'll paste that on the next line down here, hit a space, type th then a comma, space. We're going to paste this again, and then type td. This way, in one…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Adding styles to the main table element4m 51s
-
(Locked)
Targeting all TH and TD tags4m
-
(Locked)
Setting the column widths with nth child3m 31s
-
(Locked)
Styling the table body2m 39s
-
(Locked)
Styling the table footer3m 47s
-
(Locked)
Setting styles for the first column3m 10s
-
(Locked)
Adding highlights to rows5m 54s
-
(Locked)
Adding hover states (rollovers) to rows8m 4s
-