HTML Tables & Tabular Data (
Back
)
Basic Table Format
How I chose to spend my money
Purchase
Location
Date
Evaluation
Cost ($)
SUM
118
Haircut
Hairdresser
12/09
Great idea
30
Lasagna
Restaurant
12/09
Regrets
18
Shoes
Shoeshop
13/09
Big regrets
65
Toothpaste
Supermarket
13/09
Good
5
Sample Code:
<table> <caption>How I chose to spend my money</caption> <thead> <tr> <th>Purchase</th> <th>Location</th> <th>Date</th> <th>Evaluation</th> <th>Cost ($)</th> </tr> </thead> <tfoot> <tr> <td colspan="4">SUM</td> <td>118</td> </tr> </tfoot> <tbody> <tr> <td>Haircut</td> <td>Hairdresser</td> <td>12/09</td> <td>Great idea</td> <td>30</td> </tr> <tr> <td>Lasagna</td> <td>Restaurant</td> <td>12/09</td> <td>Regrets</td> <td>18</td> </tr> <tr> <td>Shoes</td> <td>Shoeshop</td> <td>13/09</td> <td>Big regrets</td> <td>65</td> </tr> <tr> <td>Toothpaste</td> <td>Supermarket</td> <td>13/09</td> <td>Good</td> <td>5</td> </tr> </tbody> </table>
Nesting Tables
title1
title2
title3
cell1
cell2
cell3
cell2
cell3
cell4
cell5
cell6
Sample Code:
<table> <tr> <th>title1</th> <th>title2</th> <th>title3</th> </tr> <tr> <td> <table> <tr> <td>cell1</td> <td>cell2</td> <td>cell3</td> </tr> </table> </td> <td>cell2</td> <td>cell3</td> </tr> <tr> <td>cell4</td> <td>cell5</td> <td>cell6</td> </tr> </table>