Remove column delimiters in html table

I have an html table with CSS. Currently, all cells have a white border around them, I can’t remove the column borders for each cell, so the rows are separated by a white line. A similar table of what I'm trying to achieve can be seen at http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs/ , see example 3 (the top table in this example). So far, my code looks like this:

<html>
<head>
<style type="text/css">
table, td, th
{
font-family:calibri;
border:collapse:collapse;
}
th
{
background-color:#b9c9fe;
color:#006add;
}
td
{
background-color:#e8edff;
color:#666699;
}
</style>

<body>
<table cellpadding="5" >
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Savings</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>
</body>
</html>
+3
source share
1 answer

There seems to be a small mistake in the style of the table: it says border:collapse:collapsewhere it should be border-collapse: collapse;.

border-bottom: 1px solid #fff; table, th, td, !

+7

Source: https://habr.com/ru/post/1756474/


All Articles