Preparing your workspace
Lists represent groups of related items, while tables represent data that naturally belongs in rows and columns.
Unordered lists use ul when the order of items does not matter. Ordered lists use ol when the sequence matters. Each list item belongs inside li. Tables should be used for real tabular data rather than for page layout. A well-structured table commonly contains table, thead, tbody, tr, th, and td. Header cells use th because they describe the related data cells. The scope attribute can make relationships between headers and data clearer to assistive technologies. Good HTML keeps the purpose of each structure clear.
A course platform may use a list for learning objectives and a table for student marks by subject.
<h2>Learning Goals</h2>
<ul>
<li>Understand HTML structure</li>
<li>Build accessible forms</li>
<li>Use semantic elements</li>
</ul>
<table>
<thead>
<tr>
<th scope="col">Student</th>
<th scope="col">Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Aman</td>
<td>92</td>
</tr>
<tr>
<td>Riya</td>
<td>88</td>
</tr>
</tbody>
</table>The page displays a bullet list of learning goals and a table containing student scores.