Data in tables should be familiar to you. Creating one in HTML can be a little tricky at first but good indenting helps:
<table summary="A table to demonstrate how to make tables">
<tr>
<th>Fruit
</th>
<th>Price
</th>
<th>Quantity
</th>
</tr>
<tr>
<td>Apple
</td>
<td>50p
</td>
<td>1Kg
</td>
</tr>
<tr>
<td>Orange
</td>
<td>60p
</td>
<td>1Kg
</td>
</tr>
</table>
The HTML is nasty but the end result is fine. Copy and paste that to the end of page2.html (before the /BODY tag) and view it. Later you will learn how to make it look prettier but for now you are still learning how to put Web page content into a structure.
Looking at the code make sure you understand:
- the table begins and ends with TABLE tags (making a table element)
- the SUMMARY attribute is used by audio readers because tables can be nasty for the visually impaired
- next you insert TR (table row) tags to make each new row element (this one has three)
- inside the TR tags you insert either TH or TD elements (these both hold content)
- TH is for table headings
- TD is for table data (text or images)
You may read about not using tables in Web pages. That's about using tables to lay out Web pages. Using tables to display data in rows and columns is still a good thing. As a guide only use tables on Web pages where you would have used a table in a paper-based document.



