Hi there
I'm making a website for a restaurant, where they want to make "room" in the menu, by starting the numbering with the following "5".
Example:
Starter
1.
2.
Salads
5.
6.
7.
8.
9.
10.
11.
Pizza
15.
17.
I want to count the numbers of TABLEs within a DIV, give the tables this number, then count the number of TRs within the TABLEs, add it all together and write it in the first TD.
When second TABLE is added, it will take the last number, from the previous TABLE (ex. 3) and find the next 5. In this case "5". If the last number was 6, the number of the next table would be 10.
Does it make sense?
<div id="menu">
<table>
<tr>
<td>1</td> //first table (1) + 1 - 1 = 1
</tr>
<tr>
<td>2</td> //last number + 1 = 2
</tr>
<tr>
<td>3</td> //last number + 1 = 3
</tr>
</table>
<table>
<tr>
<td>5</td> //last number from above (3) and find next 5 (5) = 5
</tr>
<tr>
<td>6</td> //last number + 1 = 6
</tr>
<tr>
<td>7</td> //last number + 1 = 7
</tr>
<tr>
<td>8</td> //last number + 1 = 8
</tr>
<tr>
<td>9</td> //last number + 1 = 9
</tr>
<tr>
<td>10</td> //last number + 1 = 10
</tr>
<tr>
<td>11</td> //last number + 1 = 11
</tr>
</table>
<table>
<tr>
<td>15</td> //last number from above (11) and find next 5 (15) = 15
</tr>
<tr>
<td>16</td> //last number + 1 = 16
</tr>
<tr>
<td>17</td> //last number + 1 = 17
</tr>
</table>
</div>