Tables
Element: <table> Start tag: required End tag: required Attributes: summary, width, border, frame, rules, cellspacing, cellpadding. id, class, lang, title, style, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup, more attribute info here
Tables allow you to layout text and images in your webpages into rows and cells.
Tables can be divided into a head <thead>, body <tbody>,
and footer <tfoot>. Table rows can have either table headers <th>
or table data cells <td>. You can have as many rows and columns as you wish
and it is possible to make a single cell span more then one row or column.
Tables do present problems for nontables enable user agents such as noncomputer web browsers. If absolute table sizes are used it might be necessary to scroll horizontally to view the entire site. The superior solution for laying out webpages is Cascading Style Sheets.
<table> attributes are summary, width,
border, frame, rules, cellspacing,
cellpadding, and align. summary is for supplying
a summary of the table. width is used to specify the width of the table and
can be either a pixel or percentage value. border sets the border around the
table and is set to a pixel value.
frame values are void,
above, below, hsides, lhs,
rhs, vsides, box, and border.
void shows no visible border. above shows a border for the top.
below shows a border for the bottom. hsides shows a border
on the top and bottom. vsides shows a border on the left and right.
lhs shows a border on the left hand side. rhs shows a border
on the right hand side. box shows a border on four sides.
border shows a border on four sides.
rules values are none, groups,
rows, cols, all. none
sets no rules. groups sets rules between row and column groups.
rows sets rules between rows. cols sets rules around columns.
all sets rules around all rows and columns.
cellspacing can be set to a pixel value. cellpadding can
be set to a pixel value. align values are left,
center, and right.
<tr> attributes are align and valign.
align values are left, center, and
right. valign value are top,
middle, bottom, baseline.
<td> and <th> atributes are abbr,
rowspan, and colspan. abbr is used to supply a
abbreviated version the table cell. rowspan sets the number of rows that
the cell should span. colspan sets the number of columns that the cell
should span.
<table border="1" cellspacing="3" cellpadding="3"
summary="Chart of Acme, Robotech USA, and
Rockwall modem speed and price" frame="box">
<thead>
<tr>
<th align="center"
colspan="4">Modem Speed Chart</th>
</tr>
<tr>
<td> </td>
<td>Name</td>
<td>Speed</td>
<td>Cost</td>
</tr>
</thead>
<tbody>
<tr>
<td align="center"
rowspan="4"><p>M<br />O<br />D<br />E<br />M<br />S</p></td>
</tr>
<tr>
<td>2Cons</td>
<td>33k</td>
<td>$100</td>
</tr>
<tr>
<td>Robotech USA</td>
<td>56k</td>
<td>$120</td>
</tr>
<tr>
<td>Rockwall</td>
<td>56k</td>
<td>$110</td>
</tr>
</tbody>
</table>
Modem Speed Chart Name Speed Cost M
O
D
E
M
SAcme 33k $100 Robotech USA 56k $120 Rockwall 56k $110
