Basic Tabular Structure

Every table has three essential components: the table element itself, and the rows and cells contained within it. A lot can go on in the table element, but we'll start small and build as we work through the chapter.

Let's start with a simple three-by-three grid familiar to most of us as a tic-tac-toe board (see Figure 5.1).

Figure 5.1. HTML is used to create a three-by-three tic-tac-toe table.

All contents of a table are contained within the table element. In this example, we've set just a single attribute: the border attribute. border defines the width of the edging around the table and between each cell, measured ...

Get XHTML by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.