-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Hide sorting buttons when printing #236
Comments
Good call - thanks for the suggestion! Are you using the Print button, or is this just a print of the whole web-page? |
You're welcome! I am using the print action from the browser. Side note: I wanted to add a print button and a download CSV file button to my page. But I need to style and position it myself. I wanted to use: document.addEventListener('DOMContentLoaded', function () {
let table = new DataTable('#example');
}); <button onclick="table.something()">CSV</button> but couldn't figure it out. |
The |
You could also initialise our buttons using this method and then insert into the document using the method shown there and style via CSS as needed. |
Awesome, thank you! I got my CSV button working. Later will try upgrading to the latest DataTables version and getting a print button to work. |
You can't sort tables after printing. So the "sort column" buttons in
thead
should be hidden.Here is code I am using that fixes the problem:
The text was updated successfully, but these errors were encountered: