Bootstrap Tabs and Datatables - making all tabs same size
Bootstrap Tabs and Datatables - making all tabs same size
Hi Everyone
Hopefully someone can help, this is mostly a bootstrap 3 question - but uses datatables.. I've got a tab working with 3 tabs... each tab has a datatable on it. I've got everything working - but the interface keeps scrolling as I click the tabs as each tab is of a different size. Is there a way of telling the tabs to all resize to the largest pane?
Thank you in advance for any help.
I've found some code to do this to tabs where no datatable is used, i.e. just label, text, selection, textareas, etc are used. I can post if anyone who works with bootstrap wants a copy.
This question has an accepted answers - jump to answer
Answers
Using bootstrap 3, do you have your entire tab html inside div like this?
container-fluid makes it fill the enclosing container, the width attribute on the table makes it fill the tab. It works for me to make my the tabs take up full width and for the table to take up the full width of the tab.
This example shows what you are looking for.
Allan
Hi Rduncecb
I've added the "container-fluid" to the div.. but still not working:
I'm using AJAX to fill the table:
I think it might be being caused by the Table_Container div you have around the table. Either remove it if it's not needed or try adding the container-fluid class to it.
Hi rducecb and allan.. both methods don't seem to be working for me... I'll try again on a new page, at a guess there is another div or something interfering.. or I'm missing the obvious.
At the moment I've just used css to set the tab-pane height to 450px... not ideal but it will do as a stop gap,
.tab-pane {
height: 450px;
}