DataTable Header not aligned on Bootstrap Modal

DataTable Header not aligned on Bootstrap Modal

jimboyjimboy Posts: 20Questions: 9Answers: 0

Hi,

Why is the header not aligned on a Bootstrap Modal?

see code here: http://jsfiddle.net/1aeur58f/1/

Thanks,

This question has an accepted answers - jump to answer

Answers

  • jimboyjimboy Posts: 20Questions: 9Answers: 0

    sorry, new link here...https://jsfiddle.net/9yxj7wrf/

  • jimboyjimboy Posts: 20Questions: 9Answers: 0

    The issue only happens if I set "scrollY".

  • Rob BrunRob Brun Posts: 56Questions: 2Answers: 14
    Answer ✓

    Hi jimBoy have you tried this one

    $('#myModal').on('shown.bs.modal', function (e) {
            $.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
        });
    

    I do not use the scroll y option in any of my apps so I do not know if this will be effective for you. But, when using dataTables in bootstrap 3 Modal, I don't know about 4, this straightens me out.

    Shay

  • jimboyjimboy Posts: 20Questions: 9Answers: 0

    Thank You Rob, you nailed it.

  • sbaigsbaig Posts: 1Questions: 0Answers: 0

    Cheers Rob !

This discussion has been closed.