Académique Documents
Professionnel Documents
Culture Documents
Topic Outline
o What is a table?
o Basic Table Structure
o Table Headings
Web Design & o Spanning Columns
Development o Spanning Rows
o Width and Spacing
o Border and Background
Gemma O’Callaghan
5 6
7 8
9 10
11
15
18
19
Long Tables
<thead>
<tr>
<th>Date</th>
<th>Income</th>
<th>Expenditure</th>
</tr>
</thead>
<tbody>...</tbody>
<tfoot>...</tfoot>
23 24
25
Old Code: Width and Spacing Old Code: Width and Spacing
<table width="400"
• The <width> attribute <table width="400" • The cellpadding
cellpadding="10" cellpadding="10" attribute adds space
cellspacing="10"> was used on the
cellspacing="10"> inside each cell of the
<tr> opening <table> tag to
<tr> table.
<th width="150"></th> indicate how wide that <th width="150"></th>
<th>Withdrawn</th> table should be and on <th>Withdrawn</th> • Measured in pixels.
<th>Credit</th> some <th> and <td> <th>Credit</th>
<th>Balance</th> tags to specify the <th>Balance</th>
</tr> width of individual cells. </tr>
Old Code: Border and Background Old Code: Border and Background
<table border="2" <table border="2"
bgcolor="#efefef"> bgcolor="#efefef">
<tr> <tr>
<th width="150"></th> <th width="150"></th>
<th>Withdrawn</th> <th>Withdrawn</th>
<th>Credit</th> <th>Credit</th>
<th bgcolor="#cccccc">Balance</th> <th bgcolor="#cccccc">Balance</th>
</tr> </tr>
The border attribute was used on both
<tr> ... </tr> <tr> ... </tr> the <table> and <td> elements to
</table> </table> indicate the width of the border in
pixels.
35 36
37 38