If I have a table as in this example:
<table class="detailView">
<tr>
<td>Value1</td>
<td>value2</td>
</tr>
</table>
How do I style the <tr>
and <td>
elements only if the table is of class="detailView"
?
If I have a table as in this example:
<table class="detailView">
<tr>
<td>Value1</td>
<td>value2</td>
</tr>
</table>
How do I style the <tr>
and <td>
elements only if the table is of class="detailView"
?
Use a CSS class selector:
table.detailView tr {
// your CSS properties
}
table.detailView td {
// your CSS properties
}
If your table does not have the detailView
class no style will be applied.