I have a dynamically generated table in the following schema:
<table>
<tr class="row-1">
<td>A</td>
<td>1</td>
</tr>
<tr class="row-2">
<td>B</td>
<td>2</td>
</tr>
<tr class="row-3">
<td>C3</td>
<td></td>
</tr>
<tr class="row-total">
<td>
<input type="button" value="Toogle">
</td>
<td>TOTAL</td>
</tr>
<tr class="row-1">
<td>D</td>
<td>4</td>
</tr>
<tr class="row-2">
<td>E</td>
<td>5</td>
</tr>
<tr class="row-3">
<td>F</td>
<td>6</td>
</tr>
<tr class="row-total">
<td>
<input type="button" value="Toogle">
</td>
<td>TOTAL</td>
</tr>
</table>
In this table I will only display the line with the total value, and the previous ones will be hidden and will only be displayed by a toggle.
Should I use nth-child
or is there another way to do this?