HTML and CSS Reference
Creating tables in HTML is a degree more complex than anything you've seen so far in
this topic. Think about how many different types of tables there are. A table can be a
three-by-three grid with labels across the top, or two side-by-side cells, or a complex
Excel spreadsheet that comprises many rows and columns of various sizes. Representing
tables in HTML is heavy on tags, and the tags can be hard to keep track of when you get
The basic approach with table creation is that you represent tabular data in a linear fash-
ion, specifying what data goes in which table cells using HTML tags. In HTML, tables
are created from left to right and top to bottom. You start by creating the upper-left cell,
and finish with the bottom-right cell. This will all become clearer when you see some
actual table code.
Before getting into the actual HTML code to create a table, here are some table-related
terms you'll see throughout this lesson:
The caption indicates what the table is about: for example, “Voting Statistics,
1950-1994,” or “Toy Distribution Per Room at 1564 Elm St.” Captions are
The table headings label the rows, columns, or both. Usually they're in an empha-
sized font that's different from the rest of the table. They're optional.
Table cells are the individual squares in the table. A cell can contain normal table
data or a table heading.
Table data is the values in the table itself. The combination of the table headings
and table data makes up the sum of the table.
Figure 10.1 shows a typical table and its parts.
The elements that
make up a table.