Organizing Data with Lists and Tables
Unordered Lists
Unordered lists are used when the order of items does not matter. They use the <ul>
(unordered list) and <li>
(list item) tags.
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
- Apples
- Bananas
- Cherries
Ordered Lists
Ordered lists are used when the sequence of items matters. They use the <ol>
tag with <li>
items.
<ol>
<li>Step One</li>
<li>Step Two</li>
<li>Step Three</li>
</ol>
<li>Step One</li>
<li>Step Two</li>
<li>Step Three</li>
</ol>
- Step One
- Step Two
- Step Three
HTML Tables
Tables allow you to arrange data into rows and columns using <table>
, <tr>
(table row), <th>
(table header), and <td>
(table data).
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>24</td>
</tr>
<tr>
<td>Bob</td>
<td>30</td>
</tr>
</table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>24</td>
</tr>
<tr>
<td>Bob</td>
<td>30</td>
</tr>
</table>
Name | Age |
---|---|
Alice | 24 |
Bob | 30 |