More HTML tags - tables

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:

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.

submit to reddit Delicious Tweet