Column not collapsing when data overflows
Column not collapsing when data overflows
Link to test case: https://www.jmu.edu/cevc/community-partners/test.shtml
Debugger code (debug.datatables.net): Updated versions per debugger and re-ran and issue persists
Error messages shown: None
Description of problem: The DataTable overflows off the page. I tried .responsive.recalc(), using inline table width of 100% this doesn't seem to resolve. I looked at DataTable forums, which mentioned some of those suggestions. I added debugger code (https://debug.datatables.net/) to my test case at https://www.jmu.edu/cevc/community-partners/test.shtml, and it only had some messages about new versions for DataTables, buttons and responsive. I updated the script version and those messages go away, but the problem persists. And now buttons don't show up. What am I missing?
This question has an accepted answers - jump to answer
Answers
I might be missing it but I don't see where you have installed the Responsive extension library. See the Responsive docs](https://datatables.net/extensions/responsive/) for more info. Use the Download Builder to get the code.
Kevin
That made the button return, but the issue persists.
You are loading datatable.js and datatables.css twice:
Remove the first two as they are being loaded in the combined CDN being used.
Kevin
Thanks for the pointer. Forgot to comment those out! Problem remains. I am comparing a DataTable that works with the current one that is yielding a problem.
Inspect one of the cells that should be hidden via responsive and you will see this style is being overridden:
The
tabular-cell
class is applying this style:Forcing the cell to be displayed. Disabling that style hides all the responsive cells:
And the overridden style is now applied:
Looks like you need to remove the
tabular-cell
class from thetd
to allow responsive to work properly:Kevin
I also found that it was due to the CSS customization. The .tabular-cell was set to always display as table-cell and since it had the !important keyword, it always displayed. I removed the !important keyword and things seem to function as expected now. Thanks for your responses