I am trying to figure out how to add border only inside the table with the cell spacing. When I do:
table {
border-collapse: collapse;
border-spacing: 4px;
}
table td, table th {
border: 1px solid black;
}
It works almost fine just cells without spacing. How to achieve that?
Thanks
If you’re trying to write CSS rules for tables on which you’ve defined the
cellspacingattribute, a solution could be this :But it would be much cleaner and more efficient to give a class to your table (
<table class="withspace">). So you would more classically doEDIT : just in case, if what you want is simply to have some space in your cells, add a padding value in your css :