2
I have a dynamically generated table in the following scheme:
<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 show only the line with the total value, and the previous ones will be hidden and will only be displayed by a toggle.
I must use the nth-child
or there’s another way to do it?
What/what are the "total" lines you want to show? A + B or the sum from A to F ?
– Sergio
As
TR
withclass="total"
are the ones that will be visible, @Sergio. TheTR
previous will be hidden.– Marcelo de Andrade
Only when any
TOTAL
is clicked, asTR
previous to it will be displayed.– Marcelo de Andrade