fix table column sizing issue
This commit is contained in:
@@ -15,12 +15,31 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
cardBody.querySelectorAll('.tab-pane').forEach(content => content.classList.remove('show', 'active'));
|
cardBody.querySelectorAll('.tab-pane').forEach(content => content.classList.remove('show', 'active'));
|
||||||
selectedTab.classList.add('active');
|
selectedTab.classList.add('active');
|
||||||
selectedContent.classList.add('show', 'active');
|
selectedContent.classList.add('show', 'active');
|
||||||
|
|
||||||
|
// Give the browser a moment to render the tab
|
||||||
|
setTimeout(() => {
|
||||||
|
$.fn.dataTable.tables({
|
||||||
|
visible: true,
|
||||||
|
api: true
|
||||||
|
})
|
||||||
|
.columns.adjust()
|
||||||
|
.draw();
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cardBody.querySelectorAll('.nav-link').forEach(tab => {
|
cardBody.querySelectorAll('.nav-link').forEach(tab => {
|
||||||
tab.addEventListener("click", function () {
|
tab.addEventListener("click", function () {
|
||||||
let targetTab = this.getAttribute("href");
|
let targetTab = this.getAttribute("href");
|
||||||
history.replaceState(null, null, targetTab);
|
history.replaceState(null, null, targetTab);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
$.fn.dataTable.tables({
|
||||||
|
visible: true,
|
||||||
|
api: true
|
||||||
|
})
|
||||||
|
.columns.adjust()
|
||||||
|
.draw();
|
||||||
|
}, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user