I know this is a frequently asked question, but I tried some of the solutions (e.g. How to make dividing lines / borders in a table disappear using CSS? ), But I still can not get it.
I defined through css a table structure with alternating row colors. I would like the (in particular vertical) borders between cells to be invisible, and so suppose I need either the zero width of the border td or the alternating colors of the border td so that they are the same as the background colors.
The example below is what I tried, calling the table1 identifier from html, I get a beautiful alternating color table of rows, but with explicit cell borders - I appreciate your help.
#table1 table, tr, td, th { border: 0; } #table1 tbody tr:nth-child(odd) { background-color: #A3B9D2; } #table1 tbody tr:nth-child(even) { background-color: #E7EDF3; }
and then a sample html;
<table id="table1" > <tr> <td>Test</td><td>(value)</td> </tr> <tr> <td>Test2</td><td>(value2)</td> </tr> </table>
source share