By default a table has no borders. Style it with CSS.
<style>
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #d9cfc8; padding: 8px 12px; text-align: left; }
th { background: #f8f2ee; }
tbody tr:nth-child(even) { background: #fffbf9; }
</style>
<table>
<thead>
<tr><th>Book</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>The Slow Garden</td><td>$14</td></tr>
<tr><td>River Notes</td><td>$11</td></tr>
<tr><td>Paper Moons</td><td>$9</td></tr>
</tbody>
</table>
What the CSS does
border-collapse: collapsemerges the double borders between cells into one line.paddinggives text breathing room.text-aligncontrols alignment. Left align text and right align numbers.tbody tr:nth-child(even)gives every second row a background colour, called “zebra stripes”.
Wide tables on small screens
A wide table can force the page to scroll sideways on a phone. Put the table inside a wrapper that scrolls instead.
<div style="overflow-x: auto;">
<table> ... </table>
</div>
Using the old border attribute
<table border="1">. It still works but is outdated. Control borders with CSS.