VOOZH about

URL: https://www.geeksforgeeks.org/html/what-are-cell-padding-cell-spacing-in-html-table/

⇱ What are Cell Padding & Cell Spacing in HTML Table ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

What are Cell Padding & Cell Spacing in HTML Table ?

Last Updated : 23 Jul, 2025

In this article, we will discuss the cellpadding and cellspacing properties in HTML. These properties are used with the table tag for defining the spacing and padding of a table.

Cellpadding: This property specifies the space between the border of a table cell and its contents (i.e) it defines the whitespace between the cell edge and the content of the cell.

Syntax:

<table cellpadding="value" >.....</table>

Example: In this example, we will use the cellpadding property of the table.

Output:

👁 Image

Cellspacing: This property specifies the space between cells, that is, it defines the whitespace between the edges of the adjacent cells.

Syntax:

<table cellspacing="value" >.....</table>

Example: In this example, we will use the cellspacing property of the table.

Output:

👁 Image
Comment
Article Tags:
Article Tags: