Table header is not rendering proper on bootstrap modal

Table header is not rendering proper on bootstrap modal

vikkyavikkya Posts: 3Questions: 1Answers: 0

Hi,

I have a table in my modal (boostrap v4).

table is rendering properly on my container div
as i render it in modal it's header is getting distrubed.
I'm using scrollY property

http://live.datatables.net/gicixidu/1/edit - here is the live example.

on normal div

in modal

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I'm not sure what I'm looking at here - can you give more information on what you expect to happen, please?

    Colin

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    See if this example helps:
    https://datatables.net/examples/api/tabs_and_scrolling.html

    If not please answer Colin's questions.

    Kevin

  • vikkyavikkya Posts: 3Questions: 1Answers: 0

    Hi Colin

    In my modal the table header is getting shrinked/ dis located , but when im rendering the same table in body or without some popup modal kinda thing it works fine

    I want to add scrollY with fixed header. I have seen the compatibility table, but it works in first screenshot.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I think I'm being daft here, I still don't understand the issue, my apologies - the modal looks as expected to me.

    But yep, you can't use scrollY with FixedHeader - it may work in some cases, but as it's unsupported, it's also likely to give unexpected results in others,

    Colin

  • vikkyavikkya Posts: 3Questions: 1Answers: 0

    Ok.

    But by default header is fixed in datatable right?

    if I use scrollY then that should give me scrollable table body.

    here are the edits to my screenshot

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    Did you look at the example I posted? Evn though it shows using tabs the same applies to modals. See your updated example using columns.adjust().
    http://live.datatables.net/gicixidu/3/edit

    Kevin

This discussion has been closed.