HTML and CSS Reference
In-Depth Information
Table Elements
Tables consist of rows, columns, and cells, much like spreadsheets. A row is a
horizontal line of information. A column is a vertical line of information. A cell is the
intersection of a row and a column. Figure 4-4 shows examples of these three elements.
In Figure 4-4a, the fifth row in the table has a green background. In Figure 4-4b, the
fourth column has a blue background. In Figure 4-4c, the cell at the intersection of
column 2 and row 6 has an orange background.
As shown in Figure 4-4c, a cell can be one of two types: a heading cell or a data cell.
A heading cell displays text as bold and center-aligned. A data cell displays normal text
that is left-aligned.
Understanding the row, column, and cell elements is important as you create a
table using HTML. Properties and attributes are set relative to these table elements. For
example, you can set attributes for an entire row of information, for a single cell, or for
one or more cells within a row. Appendix A lists all attributes not supported by HTML5,
indicated by a double asterisk (**). Review that appendix for more information.
Tables
Tables are useful for a
variety of purposes. They
can store information in
tabular form or create a
layout on a Web page.
(a) Table with row
background color.
one row <tr> with green
background color
column with blue
background color
(b) Table with column
background color.
(b) Table with column
background color.
cell with orange
background color
(c) Table with cell
background color.
Figure 4-4
 
Search WWH ::




Custom Search