Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

How to access attributes of td ?

$
0
0

Hello,

Please excuse me, my English is not very good.

I have a datatable array with each row of this form :

<tr id="1234">
    <td id="td_mob_1234" colspan="2"> xxxxx </td>
    <td id="td_desk_1234" style="display: none;"> yyyy </td>
    <td>aaa</td>
    <td>bbb</td>
</tr>

At some point, I need to edit all the rows in the table.
- So I get the lines of the table.
- I'm making my changes.
- And I apply them that way.

var data = datatable.rows().data();

for (var i = 0, row; row = data[i]; i++) {

    // I'm making my changes. on row[0], row[1].....

    // apply
    datatable.row(i).data(row).draw();

}

My problem is that row [0], row [1]…. contain only the inside of my td.

I would also need to access the attributes of my td, to change from colspan = 2 to colspan = 1 and from display: none to display: block for the second td.

How can I access and modify these attributes?

Thank you


Viewing all articles
Browse latest Browse all 2364

Trending Articles