From 84be741a114938dc9eb33cc9a8832c1f0fd43414 Mon Sep 17 00:00:00 2001 From: Rashif Ray Rahman Date: Fri, 7 Nov 2025 23:55:58 +0600 Subject: [PATCH 1/3] 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. --- .../html_templates/static/layout.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dqgen/resources/html_templates/static/layout.html b/dqgen/resources/html_templates/static/layout.html index 5b38430..22a3a3c 100644 --- a/dqgen/resources/html_templates/static/layout.html +++ b/dqgen/resources/html_templates/static/layout.html @@ -53,6 +53,20 @@ margin-top: 0.5em; } + /* Enable horizontal scrolling for wide tables */ + #print-container { + overflow-x: auto; + } + + .dataTables_wrapper { + overflow-x: auto; + } + + table.display { + width: 100% !important; + min-width: 100%; + } + @media print { #toc { visibility: hidden; @@ -122,9 +136,8 @@

{{ conf.title }}< 'print' ], "lengthMenu": [[5, 15, 30, -1], [5, 15, 30, "All"]], - responsive: { - details: true - } + scrollX: true, + autoWidth: false }); $("h2").each(function () { if (!$(this).next().is("section") && !$(this).next().is("h3") && !$(this).next().hasClass("dataTables_wrapper")) { From cea3f19ce547d135861b9c87b45ba992aa3d9e77 Mon Sep 17 00:00:00 2001 From: Rashif Ray Rahman Date: Tue, 11 Nov 2025 22:31:48 +0600 Subject: [PATCH 2/3] fix: restore HTML datatable scroll and print layout - remove forced table width so scrollX can size columns - allow overflow-x only on screen and expand tables for print - adjust columns on window resize to keep headers aligned --- .../html_templates/static/layout.html | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dqgen/resources/html_templates/static/layout.html b/dqgen/resources/html_templates/static/layout.html index 22a3a3c..43e797a 100644 --- a/dqgen/resources/html_templates/static/layout.html +++ b/dqgen/resources/html_templates/static/layout.html @@ -63,7 +63,7 @@ } table.display { - width: 100% !important; + width: auto; min-width: 100%; } @@ -72,11 +72,15 @@ visibility: hidden; } - #print-container { - width: 100% !important; - position: absolute; - left: 0; - top: 0; + #print-container, + .dataTables_wrapper, + .dataTables_scrollHead, + .dataTables_scrollBody { + overflow: visible !important; + width: auto !important; + } + table.display { + width: auto !important; } footer { @@ -130,15 +134,18 @@

{{ conf.title }}<