-2

私は Ajax と Stack Overflow の初心者です (多くのスレッドを読んだとしても)。class="rsWrap rsLastSpacingWrapper">同じ<td>タグを持つ要素が複数ある場合に備えて、テーブルの要素 ( ) を削除する必要があります。

<table class="rsTimelineTable" cellspacing="0" cellpadding="0" border="0" style="border-right:0px none;">
    <tbody>
        <tr class="rsAllDayRow">
            <td class="rsAllDayCell">
                <div class="rsWrap rsLastSpacingWrapper"> </div>  <!--DO NOT DELETE -->
            </td>
            <td class="rsAllDayCell">
                <div class="rsWrap rsLastSpacingWrapper"> </div> <!--DO NOT DELETE -->
            </td>
            <td class="rsAllDayCell">
                <div class="rsWrap" style="z-index:7;">
                <div id="ctl00_M_RadScheduler1_82_0" class="rsApt rsFlownDay" style="height:100%;width:100%;" title="17.10"></div>
                <div class="rsWrap rsLastSpacingWrapper"> </div> <!TO  DELETE -->
            </td>
            <!-- Other TD tag>
    </tbody>
</table>

<table class="rsTimelineTable" cellspacing="0" cellpadding="0" border="0" style="border-right:0px none;">
    <tbody>
        <tr class="rsAllDayRow">
            <td class="rsAllDayCell">
                <div class="rsWrap rsLastSpacingWrapper"> </div> <!--DO NOT DELETE -->
            </td>
            <td class="rsAllDayCell">
                <div class="rsWrap rsLastSpacingWrapper"> </div> <!--DO NOT DELETE -->
            </td>
            <td class="rsAllDayCell">
                <div class="rsWrap" style="z-index:7;">
                <div id="ctl00_M_RadScheduler1_82_0" class="rsApt rsFlownDay" style="height:100%;width:100%;" title="17.10"></div>
                <div class="rsWrap rsLastSpacingWrapper"> </div> <!-- TO DELETE -->
            </td>
            <!-- Other TD tag>
    </tbody>
</table>
<table class="rsTimelineTable" cellspacing="0" cellpadding="0" border="0" style="border-right:0px none;">
    <!-- etc etc -->
</table>

何か案は?

4

1 に答える 1

0

rsWrap rsLastspacingWrapper クラスで最後の要素を削除するには、実行できます。

$(".rsWrap, .rsLastSpacingWrapper").last().remove();

各テーブルからそれを削除するには、試すことができます(テストされていません):

$('table').each(function(){
    $(".rsWrap, .rsLastSpacingWrapper").last().remove();
});

私の構文がどれほど正しいかはよくわかりませんが、少なくともどこから始めればよいかがわかります。

于 2013-09-20T07:09:08.323 に答える