Applying Border Radius to Table Cells
To add rounded corners to table rows (tr), consider the following approach:
<code class="css">table { border-collapse: separate; border-spacing: 0; } td { border: solid 1px #000; border-style: none solid solid none; padding: 10px; }</code>
<code class="css">tr:first-child td:first-child { border-top-left-radius: 10px; } tr:first-child td:last-child { border-top-right-radius: 10px; } tr:last-child td:first-child { border-bottom-left-radius: 10px; } tr:last-child td:last-child { border-bottom-right-radius: 10px; }</code>
<code class="css">tr:first-child td { border-top-style: solid; } tr td:first-child { border-left-style: solid; }</code>
This technique allows for the creation of rounded corners on the table while maintaining the desired border and spacing.
The above is the detailed content of How to Add Rounded Corners to Table Cells Using CSS?. For more information, please follow other related articles on the PHP Chinese website!