$('#example').DataTable().column(0).width - no value?

$('#example').DataTable().column(0).width - no value?

xtech_devxtech_dev Posts: 25Questions: 11Answers: 0

Hello,

Is it possible to set column width at runtime (after table is initialized)? How to do that? using API .column(index).width doesnt seem to be right way. For columns that have been set during initialization .column(index) seems to not have width property:

http://live.datatables.net/yidedide/1/

Any ideas?

This question has an accepted answers - jump to answer

Answers

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

    Hi @xtech_dev ,

    Not really, the columns.width can only be set at initialisation. You can however, call columns.adjust() and this will recalculate based on those initial settings (say for example a column has been hidden or a row with a long piece of text has been removed),

    Cheers,

    colin

This discussion has been closed.