How can I build a table
in HTML and CSS only with the horizontal lines? I've tried so much stuff but I cant get it to work.
Something like this:
Name (space) Age
Andre (space) 12
Jose (space) 16
Potentially like this (jsfiddle):
table {
border-collapse: collapse;
width: 100%;
}
tr {
border-bottom: 1px solid #ccc;
}
th {
text-align: left;
}
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jose</td>
<td>25</td>
</tr>
<tr>
<td>Alberto</td>
<td>32</td>
</tr>
</tbody>
</table>
the css for the horizontal dividers is:
th, td {
border-bottom: 1px solid #ddd;
}
see: https://www.w3schools.com/css/css_table.asp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With