-
Notifications
You must be signed in to change notification settings - Fork 0
Enable table horizontal scrolling when wide + full page print #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| table.display { | ||
| width: 100% !important; | ||
| min-width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow DataTables to set its own table width
The added CSS sets table.display { width: 100% !important; }, which overrides the inline width that DataTables applies when scrollX: true. With the fixed width in place, the table can never grow beyond its container, so no horizontal scrollbar appears and wide tables remain truncated. Dropping the !important or the fixed width lets DataTables expand the table and enables the scroll behaviour.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed along with updating the table for screen resizes
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. Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27
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. Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27
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. Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27
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. Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27
- 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
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, plus a post-init function to update the table columns after any screen resize. Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27
The JS script of the HTML report layout initialized all tables with the same DataTables instance. This means: It treated all `<table class="display">` elements as one combined table. Some tables have 3 columns, others have 7 or more columns, and some have empty cells. DataTables tries to apply sorting logic (aDataSort) across mismatched column structures, leading to the following error in the browser console: ``` jquery.dataTables.min.js:83 Uncaught TypeError: Cannot read properties of undefined (reading 'aDataSort') ``` Replace the single initialization with per-table initialization using dynamic column mapping, and update other functions accordingly. Remove also unnecessary and redundant function wrapping from the only two functions for `#toc` and `#printButton`. WARNING: This print functionality automatically expands all pages of tables in the HTML view before the print view, so you will have to refresh the page if you desire the paging reactivated.
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, plus a post-init function to update the table columns after any screen resize. Also, add/restore full HTML report print functionality (unsure if this ever worked). Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27 fix
costezki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
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, plus a post-init function to update the table columns after any screen resize. Also, add/restore full HTML report print functionality (unsure if this ever worked). Application of meaningfy-ws/diff-query-generator#33. Fixes gh-130, DIF1-27 fix
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
scrollXand accompanying CSS to allow the scrollbar on the DataTable, plus a post-init function to update the table columns after any screen resize. Also, add/restore full HTML report print functionality (uncertain if this ever worked).