Bootstrap classes doesn't work with ajax data?
Bootstrap classes doesn't work with ajax data?
sergeda
Posts: 42Questions: 16Answers: 0
When I have my table rendered with data I use col-md-1, col-md-2 etc classes to set width for each column. But after I switch to ajax data now this classes doesn't work. How can I set width for each column?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Where are you using those since they do not apply to the table itself? You might need to use the dom option to better define how the classes are used.
We need to see your code to figure out what you are doing.
I appy them to th like this:
But with ajax data this doesn't work
In all honesty, you are miss using the classes, they are intended to be used in a div container with div rows and columns.
If you want to set certain widths, either add widths in columnDefs or columns options or define a class and set that with className in one of the two above options.
Some more info here https://datatables.net/reference/option/columns.width
Thanks a lot