![]() |
VOOZH | about |
The cellspacing attribute in HTML is used to define the space between cells in a table. It controls the amount of space, in pixels, between the table cells. This spacing can make the table's content more readable by adding extra room between cells.
However, it's important to note that the cellspacing attribute is not supported in HTML5, and modern developers usually use CSS to manage the space between cells.
Note: The <table> cellspacing Attribute is not supported by HTML 5.
<table cellspacing="pixels">Attribute Value | Description |
|---|---|
pixels | It sets the space between the cells in terms of pixels. |
In this example, we set the cellspacing attribute to 10 pixels, meaning there will be a 10-pixel gap between each cell.
Output:
π Screenshot-2023-12-19-152332
Letβs try a different value for the cellspacing attribute. Here, we set the cellspacing to 10 pixels:
Output:
π Screenshot-2023-12-19-152627
While the cellspacing attribute was once a common way to control the space between table cells in HTML, it is no longer supported in HTML5. Instead, you should use CSS for this purpose, which gives you greater control and flexibility.