Category: html_css
HTML tables
Published on 23 Jun 2026
Explanation
HTML tables are used to display
data in rows and columns. The
main tags used are <table>, <tr>,
<th>, and <td>.
Code:
<table border="1">
<tr>
<th>Name</th>
<th>Course</th>
</tr>
<tr>
<td>John</td>
<td>Java</td>
</tr>
</table>
Explanation
The <th> tag defines a table
header cell, while the <td> tag
defines a table data cell.
Code:
<table border="1">
<tr>
<th>ID</th>
<th>Name</th>
</tr>
<tr>
<td>101</td>
<td>Alice</td>
</tr>
</table>
Explanation
An unordered list (<ul>) displays items
with bullet points and is commonly
used for menus and item collections.
Code:
<ul> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ul>
Explanation
An ordered list (<ol>) displays items
in a numbered sequence, making it
useful for steps or rankings.
Code:
<ol> <li>Install VS Code</li> <li>Learn HTML</li> <li>Build Projects</li> </ol>
Explanation
Lists can be nested inside other
lists to represent hierarchical
data structures.
Code:
<ul>
<li>Frontend
<ul>
<li>HTML</li>
<li>CSS</li>
</ul>
</li>
</ul>