How get Name of Title of column?

How get Name of Title of column?

casuistcasuist Posts: 41Questions: 16Answers: 0

column().name() or column().title() Not Work. No function message.
How get Name of Title of column?
Thanks!

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @casuist ,

    Do you mean the text in the header cell, you can use column().header() for that - see example here.

    Cheers,

    Colin

  • Diego.yednakDiego.yednak Posts: 1Questions: 0Answers: 0

    Hi @casuist,

    you can also use this

    const table = $('#example').DataTable();
    table.context[0].aoColumns.forEach(function (column) {
    console.log("id:", column.idx, "name: ", column.title);
    });

Sign In or Register to comment.