|
Back to HTMLhtml Lesson 4

Tables & Divs

Organize data and group content.

HTML Tables

Tables allow us to arrange data into rows and columns using `<table>`, `<tr>` (row), `<th>` (header), and `<td>` (data).

html
<table>
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>John</td>
    <td>25</td>
  </tr>
</table>

Try it yourself:

HTML
CSS
Result

Divisions

The `<div>` tag is a generic container used to group elements together for styling purposes. It has no semantic meaning but is essential for layouts.

html
<div class="card">
  <h2>Title</h2>
  <p>Content goes here...</p>
</div>

Try it yourself:

HTML
CSS
Result