Table data is not align with table header

Table data is not align with table header

mywishu190mywishu190 Posts: 1Questions: 1Answers: 0

Table data is not align with table header during initialization, but on changing the show entry value, It gets align properly. can you help me to solve the same.
Thanks in Advance

Answers

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49

    Make sure your table is visible during initialization. If it is not, then you need to have a function, like the one below, you can call whenever the table becomes visible.

    prettyTable: function(dt, timeout) {
        (function() {
            dt.columns.adjust().draw();
        }).delay(timeout || 100);
    }
    

    The timeout is to allow any animations to finish before executing .draw(). I find 100ms to be a good default, but anywhere between 100-300ms will do the trick.

This discussion has been closed.