With HTML, you can layout information on the page using the list and table elements. This lesson describes the basics of these elements. Lists Lists can be defined as ordered <ol> or unordered <ul>. Ordered lists are displayed with numbers by default, while unordered lists are displayed with bullet items. With either type of list, the elements of the list are defined with list items <li>. Here's an example:
<ol>
<li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> Because it is an ordered list, it will appear as:
<ul type=circle> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> This example is from the w3c tutorials: http://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml_lists. Click on this link and you can use the tutorial to try out variations of the list elements. Tables Here's an example of a table in HTML: <table width="200" border="1"> A
table element consists of table-row elements (<tr>). Each row
consists of either table header elements (<th>), or table data
elements (<td>)<tr> <th>Average</th> <th>Home runs</th> <th>RBI</th> </tr> <tr> <td>.323</td> <td>16</td> <td>83</td> </tr> <tr> <td>.295</td> <td>45</td> <td>112</td> </tr> <tr> <td>.233</td> <td>5</td> <td>45</td> </tr> </table> In-Class Assignment: Create a table of size 2x2 with pictures of your four favorite presidents. Each picture should have a caption. |
