HTML and CSS Reference
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 …
have ro ws…
Walla Walla, WA
Magic City, ID
Last Chance, CO
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?