私はそれが以前にすでに尋ねられたことを知っています、しかし私は以前の解決策を試しました、そしてそれらは私のために働いていません。
AJAXによって生成されているHTMLテーブルがあります。
<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="c m 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="l t RowHeader">Fours</th>
<td class="r b Data">15 341,10</td>
<td class="r b Data">15 540,90</td>
<td nowrap="" class="r b Data"> -1.29% </td>
</tr>
<tr>
<th scope="row" class="l t RowHeader">Hifi</th>
<td class="r b Data">10 578,60</td>
<td class="r b Data"> 9 962,50</td>
<td class="r b Data"> 6.18% </td>
</tr>
<tr>
<th scope="row" class="l t RowHeader">Magneto</th>
<td class="r b Data">10 090,10</td>
<td class="r b Data">10 495,60</td>
<td nowrap="" class="r b Data"> -3.86% </td>
</tr>
<tr>
<th scope="row" class="l t RowHeader">Total</th>
<td class="r b Data">36 009,80</td>
<td class="r b Data">35 999,00</td>
<td class="r b Data"> 1.04% </td>
</tr>
</tbody>
</table>
SAS(Statistical Analysis Software)を使用している別のグループによって作成されているため、テーブル内のクラスをあまり制御できません。
tbodyの各行の最後のtdを取得したいと思います。
今のところ、私はその仕事をするために次のjQueryを持っています:
$( '#ajax-area table tbody tr td:last' ).addClass( 'result' );
これは、クラスをtdに追加するものではありません。
誰かが解決策を持っていますか?