It should be very simple but I can't figure it out.
I have a table like this :
<table class="category_table">
<tr><td> blabla 1</td><td> blabla 2 </td></tr>
<tr><td> blabla 3 </td><td> blabla 4 </td></tr>
</table>
I want to make td
tags of first tr
row have vertical-align
. But not the second row.
.category_table td{
vertical-align:top;
}
This question is related to
html
css
css-selectors
html-table
This should do the work:
.category_table tr:first-child td {
vertical-align: top;
}
Below works for first tr
of the table under thead
table thead tr:first-child {
background: #f2f2f2;
}
And this works for the first tr
of thead
and tbody
both:
table thead tbody tr:first-child {
background: #f2f2f2;
}
Source: Stackoverflow.com