Size to parent div

Size to parent div

tonelm2tonelm2 Posts: 5Questions: 2Answers: 0

There are multiple questions around about how to get datatables to size according to its parent, but I cant get anything to work.

At the moment Ive got a problem where after I dynamically populate a table with data, then it overflows its parent div and shows as a right mess.

What are other people doing when trying to contain a datatable without overflowing?

Answers

  • kthorngrenkthorngren Posts: 17,722Questions: 25Answers: 4,204
    edited February 2022

    Here are some ideas:

    • First look at this example to make sure you are using style="width:100%" on the table tag.
    • If the data in the row is too wide to fit the container then use responsive to hide the columns or use scrollX.
    • Use the ellipsis plugin to reduce the width of the data in the columns.

    Kevin

  • tonelm2tonelm2 Posts: 5Questions: 2Answers: 0

    Width always seems to work, its the height that keeps overflowing :-(

  • kthorngrenkthorngren Posts: 17,722Questions: 25Answers: 4,204

    Oh. Here are a couple options I can think of:

    Kevin

Sign In or Register to comment.