HTML
HTML Tables
Padding and Spacing

Padding in HTML

In HTML, padding is a property used to control the space around elements, specifically within tables and other elements.

Padding

Padding refers to the space between the content of an element (like text or images) and its border. In the case of tables, it's the space between the content inside the cells and the edges of the cells.

Padding is applied inside the element, affecting the content's positioning within the element’s box.

HTML Table Padding & Spacing

HTML tables can adjust the padding inside the cells, and also the space between the cells.

With Padding

<table>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
</table>
 

With Spacing

<table>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
  <tr>
    <td>hello</td>
    <td>hello</td>
    <td>hello</td>
  </tr>
</table>