Cellpadding
cellpadding
is an attribute in HTML that is used to define the amount of space (padding) between the content of a table cell and its borders. It is typically used within the <table>
element to control the spacing within individual cells.
The cellpadding
attribute accepts a numerical value, which represents the number of pixels of space to be added inside each cell. This space is added on all four sides of the cell content.
Here's an example of how the cellpadding
attribute is used:
<table cellpadding="10">
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>
In this example, each cell in the table will have a padding of 10 pixels on all sides, creating space between the content of the cell and its borders.
It's worth noting that while the cellpadding
attribute is still supported in modern HTML, it is considered a presentational attribute. In modern web development, styling is often handled using CSS (Cascading Style Sheets) rather than HTML attributes. Using CSS, you can achieve similar effects by applying styles to the cells or the table itself.
Thank you,