More Complicated Coding


The <ul> and <ol> elements define numbered and bulleted lists respectively. Each list item must be enclosed in <li> tags as shown below:

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

Lists can be nested inside each other.

The <table> tag can also be used to represent tabular data. It has the following structure:

<table> Table Element
<tr> Table Row
<td>Content</td> Column Title (needed for accessibility)
</tr> Table Cell
</table>  

Here is the code for a three-column table:

<table>
<tr>
<th>Column A</th>
<th>Column B</th>
<th>Column C</th>
</tr>
<tr>
<td>Row 1</td>
<td>Row 1</td>
<td>Row 1</td>
</tr>
<tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
</tr>
</table>

The content inside the <th> (table header) tags renders in bold. Although the table header row is not strictly necessary, it is considered good practice to include it in order to make the data accessible to people with vision impairments.

Return to Top