Sometimes, we want to add padding to a table row with CSS.
in this article, we’ll look at how to add padding to a table row with CSS.
How to add padding to a table row with CSS?
To add padding to a table row with CSS, we set the padding properties.
For instance, we write
td {
padding-top: 20px;
padding-bottom: 20px;
padding-right: 20px;
}
td:first-child {
padding-left: 20px;
padding-right: 0;
}
to set the padding properties for the td elements to add padding to the cells.
Conclusion
To add padding to a table row with CSS, we set the padding properties.