Sorry to ask this question, as I know that he was already asked. However, I tried the previous solutions and they do not work for me.
I have an HTML table as such, which is created by AJAX.
<table cellspacing="1" cellpadding="7" summary="Procedure Tabulate: Table 1" frame="box" rules="groups" class="table table-bordered table-hover"> <thead> <tr> <th scope="col" class="cm Header"> </th> <th scope="col" class="c Header">reel</th> <th scope="col" class="c Header">budgete</th> <th scope="col" class="c Header">ecart</th> </tr> </thead> <tbody> <tr> <th scope="row" class="lt RowHeader">Fours</th> <td class="rb Data">15 341,10</td> <td class="rb Data">15 540,90</td> <td nowrap="" class="rb Data"> -1.29% </td> </tr> <tr> <th scope="row" class="lt RowHeader">Hifi</th> <td class="rb Data">10 578,60</td> <td class="rb Data"> 9 962,50</td> <td class="rb Data"> 6.18% </td> </tr> <tr> <th scope="row" class="lt RowHeader">Magneto</th> <td class="rb Data">10 090,10</td> <td class="rb Data">10 495,60</td> <td nowrap="" class="rb Data"> -3.86% </td> </tr> <tr> <th scope="row" class="lt RowHeader">Total</th> <td class="rb Data">36 009,80</td> <td class="rb Data">35 999,00</td> <td class="rb Data"> 1.04% </td> </tr> </tbody> </table>
I do not have much control over the classes in the table, because they are created by another group of people using SAS (Statistical Analysis Software).
I would like to get the last td of each line in tbody.
At the moment, I have the following jQuery to do the job:
$( '#ajax-area table tbody tr td:last' ).addClass( 'result' );
This does not add the class to td.
Does anyone have a solution? thanks in advance
xonorageous
source share