Skip to content

Commit 84be741

Browse files
committed
fix: enable table horizontal scrolling when wide
Wide tables did not trigger a horizontal scrollbar either on the page or the table, therefore cutting off the table. Add some JavaScript and CSS tricks suggested by CursorAI, namely with `scrollX` and accompanying CSS to allow the scrollbar on the DataTable.
1 parent 39d8e9a commit 84be741

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

dqgen/resources/html_templates/static/layout.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@
5353
margin-top: 0.5em;
5454
}
5555

56+
/* Enable horizontal scrolling for wide tables */
57+
#print-container {
58+
overflow-x: auto;
59+
}
60+
61+
.dataTables_wrapper {
62+
overflow-x: auto;
63+
}
64+
65+
table.display {
66+
width: 100% !important;
67+
min-width: 100%;
68+
}
69+
5670
@media print {
5771
#toc {
5872
visibility: hidden;
@@ -122,9 +136,8 @@ <h1 class="ui header center aligned reportTitle" id="skip-toc">{{ conf.title }}<
122136
'print'
123137
],
124138
"lengthMenu": [[5, 15, 30, -1], [5, 15, 30, "All"]],
125-
responsive: {
126-
details: true
127-
}
139+
scrollX: true,
140+
autoWidth: false
128141
});
129142
$("h2").each(function () {
130143
if (!$(this).next().is("section") && !$(this).next().is("h3") && !$(this).next().hasClass("dataTables_wrapper")) {

0 commit comments

Comments
 (0)