Skip to content
Justice Tech School

Table Borders and Padding

Borders belong to table, th and td. border-collapse: collapse merges double borders. Padding adds room inside cells.

Example
<style>
  table, th, td { border: 1px solid #64748b }
  table { border-collapse: collapse }
  th, td { padding: 8px }
</style>
<table><tr><th>Name</th><th>Age</th></tr><tr><td>Ada</td><td>30</td></tr></table>

Exercise

Merge borders.

border-collapse: ;

Quiz Test

What does border-collapse do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.