This project is not covered by Drupal’s security advisory policy.
Note: the current DataTables library is 1.10 while this module is based on 1.9.4. The correct library is loaded automatically when you use drush to install the module (see drush commands below). If you wish to install the module manually, you can obtain the DataTables 1.9.4 files from this issue: https://drupal.org/node/2259283#comment-8748515
Table Trash is pixie dust for your HTML tables.
Sprinkling your tables with tricks, trinkets and tools, TT turns the humble table into a responsive treasure trove of data that is easy to re-arrange and navigate.
Leveraging off the DataTables jQuery library, this module presents you with some handy bells and whistles that you may enable for any HTML table on your site. This means tables produced by the Views module, core pages like admin/content, admin/reports/dblog, admin/reports/hits, user-created content... nearly any page, as long as its tables use the <table> tag compliantly.
In summary, this module allows you to do any or all of the following. Read with this screenshot open or try it live.
- search box to filter out rows based on keywords entered by the visitor
- responsively hide columns on narrow screens; but click the plus-icon and the hidden cells appear below the selected row
- page and sort in the browser --i.e fast!--, rather than via the server
- re-arrange the order and widths of columns, handy for preparing screenshots/print-outs
- fix the table header at the top of the window, when scrolling tall tables
- "over-size": virtually widen the table and add horizontal scroll
- add buttons to export to clip-board, Excel, PDF or to print
All of this straight out of the box on any table on your site -- no programming!
This is a client-side solution that does not make additional round-trips to the server. All functions are executed in the browser.
Installation
Depending on the functions you use, you need to download one or two javascript libraries. The README gets you up and running quickly. Quicker still is to use the built-in Drush interface which downloads and unzips the required libraries for you and puts them in the correct places.
drush dl table_trash
drush en table_trash
drush dl-datatables
Works great with...
TT has been architected to work with any HTML tables including those produced by Views plugins. So you can use TT in combination with these:
Feature-ready
All Table Trash configuration is stored in a couple of standard Drupal variables, so can be captured and exported as a Feature. Just make sure Strongarm is enabled also.
Roadmap
Extensions under consideration:
- Grouped column headers
- D8 port
Acknowledgement
This module came about when we tried to develop a patch for the DataTables module that would get around its and Views' limitations of 1) only working for tables in Views and 2) preventing other plugins to also operate on the same tables, like the modules listed above. After much discussion and efforts to retrofit the new extensions into the DataTables module, it became clear that this could not be done without an architectural overhaul of the original and breaking backward compatibility of configuration settings as well as the UI.
Thus the birth of Table Trash. We believe there's a place for both modules on Drupal.org.
Table Trash borrows no code from the DataTables module. However, the inspiring work by the author of DataTables, duellj, is gratefully acknowledged.
Love trashy modules? Try the others in this series: Table Tidy, Label Trash, HTML Title Trash, Site Name and Slogan Rotator.
Picture of Marly from Snapshots of Existence.
Project information
- Project categories: Content editing experience, Developer tools
216 sites report using this module
- Created by rdeboer on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.




