Min Table Width

Min Table Width

efecarranzaefecarranza Posts: 2Questions: 1Answers: 0

Hi all,

I use datatables for my web application, which was not supposed to be used in phones, but now team leader wants it fully responsive, or as much as can be done.
For some reason, my datatables with width of 100%, will not shrink below 727px.
The width works fine until I hit that size, and then they won't get smaller and scrolling doesn't work either.
How can I solve this problem?

Thank you

Answers

  • burncharburnchar Posts: 118Questions: 12Answers: 0

    Have you considered using the Responsive plugin?
    https://datatables.net/extensions/responsive/

  • efecarranzaefecarranza Posts: 2Questions: 1Answers: 0

    hey burnchar, thanks for the prompt response.
    is there a way to do this without adding responsive?
    adding responsive causes all these other problems to how i have the tables set up

  • burncharburnchar Posts: 118Questions: 12Answers: 0

    Unfortunately I do not know how to directly reduce the table's minimum size. It is, however, just HTML and CSS, so I am sure there's a way to do so.

    Besides the Responsive plugin, you might also try the "scrollY" feature.

    As an aside, I would have thought 727px can fit on any reasonably modern mobile device, even those that have no internal scaling coefficient and display with 727 actual pixels of screen resolution. I am curious how the table looks at 727px.

  • AliBahAliBah Posts: 11Questions: 0Answers: 0

    I think this is because of header titles. Table cannot be minimized less then minimum sum of table titles width.

  • allanallan Posts: 63,732Questions: 1Answers: 10,508 Site admin

    It sounds like the content in the table simply can't be displayed any smaller than 727px (the exact value might change as the data being disabled changes).

    I think you have two options, like burnchar suggests:

    1. Use Responsive
    2. Use scrollX

    Allan

This discussion has been closed.