26. Review of HTML Tables
26. Review of HTML Tables
- Table: <table>
- Defines a table.
- Column groups: <colgroup>, <col>
- Groups one or more related columns together.
- A <colgroup> may contain one or more <col>,
or may use the span attribute to define
the number of columns it covers.
- A <col> can also be defined outside a
<colgroup>.
- Row groups: <thead>, <tfoot>, <tbody>
- Contain one or more related rows (<tr>).
- <thead> and <tfoot> must be defined before normal rows,
and are always displayed at the top and bottom of the table,
respectively.
- There may be multiple <tbody> elements, for grouping related
rows together.
- Rows: <tr>
- Should contain one or more cells.
- Cells: <th> and <td>
- Contain data for individual cells.
The rowspan and colspan attributes can make a cell cover
more than one row or column.
Avoid using HTML attributes align, valign, bgcolor, width, etc.; use CSS instead.