I have a simple table, with a box-shadow
, but I want to exclude the very first cell from any shadow.
I've tried adding box-shadow: none
to that cell but it doesn't override the shadow on the whole table. I'm not even sure if this is possible?
HTML:
<table>
<tr class="header">
<td></td>
<td>hello</td>
<td>hello</td>
<td>hello</td>
</tr>
<tr>
<td>row 1</td>
<td>row 1</td>
<td>row 1</td>
<td>row 1</td>
</tr>
<tr>
<td>row 2</td>
<td>row 2</td>
<td>row 2</td>
<td>row 2</td>
</tr>
<tr class="last-row">
<td>row 3</td>
<td>row 3</td>
<td>row 3</td>
<td>row 3</td>
</tr>
</table>
CSS:
table {
width: 80%;
margin: 30px;
box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.24), 0 1.5px 6px rgba(0, 0, 0, 0.12);
}
.header {
height: 50px;
vertical-align: middle;
text-align: center;
color: #fff;
background: red;
}
.header td {
border-bottom: 2px solid #ccc;
}
.header td:first-of-type {
background: #fff;
}
.last-row td {
border: none !important;
}
tr td:not(.header) {
height: 60px;
text-align: center;
border-bottom: 1px solid #ccc;
}
Here's a fiddle to show an example of a table
Is this possible?
UPDATE
By first cell I mean first cell in row with class header
- table .header td {}
This is an image of the perfect result: