Problem with responsive datatable with fixed column width

Problem with responsive datatable with fixed column width

TigransTigrans Posts: 5Questions: 2Answers: 0

if I set all columns expect one or two to specific width and set datatable as response, and resize window,
all columns with predefined width stay with their width and if there is no space for them they hide,
but columns without width, change their width until 0 and whenever some other column hide they (column without width) show again.
So my question is, is it possible to set min-width to column, which has no specific width ?

this is initial state (width 1300px)
https://drive.google.com/file/d/0BwOr1sXLzHm3ckQzeFkwT1duX1E/view?usp=sharing

after a little resize window (width 1090px)
https://drive.google.com/file/d/0BwOr1sXLzHm3cXhkM1FNcU1vUVU/view?usp=sharing

and the last one (width 1000px)
https://drive.google.com/file/d/0BwOr1sXLzHm3YkwxWUdHaldEZW8/view?usp=sharing

Answers

  • allanallan Posts: 63,815Questions: 1Answers: 10,517 Site admin

    I get the impression you might have used table-layout: fixed, although without a test case I can't say for sure. If that is the case you could use CSS to set a min-width I think.

    Allan

  • TigransTigrans Posts: 5Questions: 2Answers: 0
  • allanallan Posts: 63,815Questions: 1Answers: 10,517 Site admin

    Thanks - you are using table-layout: fixed. Did you try setting a min-width?

    Allan

  • TigransTigrans Posts: 5Questions: 2Answers: 0

    yes, I tried to add min-width on "Info" column but it's not helping

  • allanallan Posts: 63,815Questions: 1Answers: 10,517 Site admin

    It looks like (Chrome at least) is just ignoring the min-width on the browser column. Here is an example without DataTables: https://jsfiddle.net/vaL7y304/1/ (you need to make the output view fairly wide to see the Info column).

    I'm not sure what DataTables can do here in that case I'm afraid.

    Allan

This discussion has been closed.