In this Answer, we'll look at the two attributes of the table
tag in HTML: cellpadding
and cellspacing
.
Whereas the cell padding attribute places space around the data, the cell spacing attribute places space around each cell in the table.
<table cellspacing="" cellpadding=""></table>
In the following example, we create three HTML tables, the first one without cell padding and cell spacing, the second one with cell padding, and the third one with cell spacing.
In the code snippet above:
border=1
and without cell spacing and cell padding.border=1
and cellpadding=10
.border=1
and cellspacing=10
.The output of the code shows that space is created around the data in the second table, while space is created around the cell in the third table.
Free Resources