HTML Table - Cell PaddingCell padding is the space between the cell edges and the cell content.
By default, the padding is set to 0.
To add padding on table cells, use the CSS padding property:
Example Code:
Output:
To add padding only above the content, use the padding-top property. And the others sides with the padding-bottom, padding-left, and padding-right properties:
Output:
Cellpadding - top - bottom - left - right
We can specify different padding for all fours sides of the cell content.
Firstname | Lastname | Age |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
John | Doe | 80 |
Output:
Cellspacing
Change the space between the cells with the border-spacing property.
Firstname | Lastname | Age |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
John | Doe | 80 |
Comments :
Post a Comment