JQuery вставить тег Tbody в таблицу

0

как я могу вставить тег tbody в таблицу. так что тетушка должна покрыть тег ""

это мой стол:

<table id="contacts-table" data-role="table" data-mode="reflow" class="ui-responsive table-stroke ui-body-d ui-bar-d table-stripe ui-table ui-table-reflow">
    <thead>
        <tr id="contacts-head">
            <th data-priority="1">ID</th>
            <th data-priority="persist">Name</th>
            <th data-priority="2">Vorname</th>
            <th data-priority="3"><abbr title="Rotten Tomato Rating">E-Mail</abbr>
            </th>
            <th data-priority="4">Aktionen</th>
        </tr>
    </thead>


    <tr id="entry-16">
        <td><b class="ui-table-cell-label"></b>16</td>
        <td><b class="ui-table-cell-label"></b>Erolerer</td>
        <td><b class="ui-table-cell-label"></b>Babacan</td>
        <td><b class="ui-table-cell-label">[email protected]</td>
        <td><b class="ui-table-cell-label"></b>Edit| Remove</a>
        </td>
    </tr>

</table>

это должно выглядеть так:

    <table id="contacts-table" data-role="table" data-mode="reflow" class="ui-responsive table-stroke ui-body-d ui-bar-d table-stripe ui-table ui-table-reflow">
        <thead>
            <tr id="contacts-head">
                <th data-priority="1">ID</th>
                <th data-priority="persist">Name</th>
                <th data-priority="2">Vorname</th>
                <th data-priority="3"><abbr title="Rotten Tomato Rating">E-Mail</abbr>
                </th>
                <th data-priority="4">Aktionen</th>
            </tr>
        </thead>

   <tbody>
        <tr id="entry-16">
            <td><b class="ui-table-cell-label"></b>16</td>
            <td><b class="ui-table-cell-label"></b>Erolerer</td>
            <td><b class="ui-table-cell-label"></b>Babacan</td>
            <td><b class="ui-table-cell-label">[email protected]</td>
            <td><b class="ui-table-cell-label"></b>Edit| Remove</a>
            </td>
        </tr>
    </tbody>

</table>

это моя демонстрация: http://jsfiddle.net/aldimeola1122/6Q2za/

как я могу это достичь? заранее спасибо

Теги:
html-table

2 ответа

1
$('#entry-16').wrap( "<tbody />" );
1
$(document).ready(function(){

  $('table #entry-16').wrap( "<tbody></tbody>" );

});

doc: http://api.jquery.com/wrap/

Ещё вопросы

Сообщество Overcoder
Наверх
Меню