HTML tables can adjust the padding inside the cells, and also the space between the cells.
hello | hello | hello |
hello | hello | hello |
hello | hello | hello |
hello | hello | hello |
hello | hello | hello |
hello | hello | hello |
Cell 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:
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:
th, td {
padding-top: 10px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 40px;
}
Try it Yourself »
Cell spacing is the space between each cell.
By default the space is set to 2 pixels.
To change the space between table cells, use the CSS border-spacing
property on the table
element:
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!