HTML and CSS Reference
In-Depth Information
How do you make tables with HTML?
Tony's right; you really haven't seen a good way of using HTML to represent
his table data, at least not yet. You do know there's a way to use CSS and
<div> s to create a table-like layout (with CSS table display), but that's for layout
(presentation) purposes, and isn't related to the content itself. Here, we've got
tabular data that we want to mark up with HTML. Luckily, HTML has a <table>
element to take care of marking up tabular data. Before we dive into the <table>
element, let's first get an idea of what goes into a table:
We h a ve c o l u m n s …
Diner
Rating
City
Date
Temp
Altitude
Population
And we
have ro ws…
Walla Walla, WA
June 15th
75
1,204 ft
29,686
4/5
Magic City, ID
June 25th
74
5,312 ft
50
3/5
Bountiful, UT
July 10th
91
4,226 ft
41,173
4/5
Last Chance, CO
July 23rd
102
4,780 ft
265
3/5
Truth or
Consequences,
NM
August 9th
93
4,242 ft
7,289
5/5
Why, AZ
August 18th
104
860 ft
480
3/5
We call eac h piece o f data a cell ,
or sometim es just t able dat a.
If they put you in charge of HTML, how would you design one or more
elements that could be used to specify a table, including headings, rows,
columns, and the actual table data?
 
 
Search WWH ::




Custom Search