Our Biggest Sale Is Here
Up to 70% Off
Get the Deal

How to add export and print buttons to a table in wpDataTables

Say your sales team opens a price list on your intranet every week and pastes it into a spreadsheet for their offers. Instead of selecting rows by hand, they can click Excel or CSV above the table and get a file. Table Tools is a row of buttons above a table: copy to clipboard, print, export to Excel, CSV and PDF, and column visibility for visitors. You turn it on and pick the buttons per table, with Tabella AI or in the Table Tools tab.

How do I add table tools with Tabella AI?

Open the table, click Ask Tabella AI and say which buttons you want.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Ask Tabella AI. Click Ask Tabella AI and type, for example: Show only the Excel and CSV export buttons above the table.
  3. Check and save. Tabella AI lists what it changed. Click Save Changes, or Undo table changes to go back.

How do I add table tools in the table settings?

Turn on Table Tools in the Table Tools tab, pick the buttons and save the table.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Open the Table Tools tab. In the table settings above the preview, click Table Tools.
  3. Turn on the toolbar. Under Table Tools, turn on Enable Table Tools.
  4. Pick the buttons. Open the Buttons list and check the ones you want: Columns visibility, Print, Excel, CSV, Copy and PDF.
  5. Set the PDF options. If you chose PDF, set PDF Paper Size, for example A4, and Page orientation, for example Portrait.
  6. Save the table. Click Save Changes.
The Table Tools tab of a wpDataTables table with Enable Table Tools on, the Buttons list open with Print, Excel, CSV and Copy checked, and the PDF Paper Size and Page orientation fields
Setting up Table Tools, shown as overlapping panels: (1) the Table Tools tab, (2) the Table Tools switch, (3) the Buttons list, (4) the PDF options, (5) Save Changes.

Include Table title (Show table title in export files (Excel and Copy)) adds the table title to Excel and Copy exports. The Include HTML option (Enable HTML in export files (CSV, Excel, Print and Copy)) exports columns with HTML, such as links, images, emails and attachments, as HTML in CSV, Excel, Print and Copy. It does not work for PDF. Check the result on the front end, because in the back end preview the header buttons are rendered as HTML too.

What does each button do?

Each button works on the rows the table holds in the browser:

Button What visitors get
Copy Copies the rows with their headers to the clipboard, separated by tabs, ready to paste into Excel. A message shows how many rows were copied.
Print Hides everything on the page except the table and opens the print dialog. Some themes print the page differently.
Excel An Excel file with the table data.
CSV A comma-separated file with the headers and all values.
PDF A simple PDF with the page title and the table, in the orientation and paper size you set.
Columns visibility A list of columns that visitors check or uncheck to show or hide them. It also lists columns you hid in the back end.

The exported files are named after the table. To set your own file name and title, add export_file_name to the table shortcode:

[wpdatatable id=1 export_file_name='Weekly price list']

The files are then called Weekly price list.pdf, Weekly price list.xlsx and so on.

On the front end, the buttons sit above the table as icons: an eye icon opens the column visibility list, a printer icon prints the table, and a download icon opens a menu with the export buttons.

A wpDataTables table on the front end with the column visibility, print and download buttons above it and the column visibility list open
Table Tools on the front end: (1) the buttons above the table, (2) the column visibility list.

What are the limits of table tools?

The buttons use a third-party HTML5 library, which sets these limits:

  • With server-side processing, only the rows on the current page are copied, printed or exported. Choose All in the rows per page menu before you export the whole table.
  • Simple tables don’t have Table Tools.
  • The layout of the PDF, Excel and CSV files can’t be customized, except for the title and file name.
  • Conditional formatting, row grouping and your own customizations are not exported.
  • Formula columns are exported as values, and totals, averages, minimum and maximum are not exported.
  • Images can’t be exported as images; use Include HTML to export them as HTML.
  • Hidden columns are not exported or printed.
  • Numbers with a comma as decimal separator can export wrong to Excel. Use CSV, or change the column type to String.

What should I remember about table tools?

Ask Tabella AI, or turn on Table Tools in the table settings, and pick the buttons visitors need: Copy, Print, Excel, CSV, PDF and Columns visibility. Set the PDF orientation and paper size in the same tab, and the file name with export_file_name in the shortcode. Exports contain values only, without formatting, formulas or hidden columns, and server-side tables export only the visible page.

Wait, Before You Download!

To get your hands on wpDataTables Lite, please enter your email address below. We’ll send you a direct download link and keep you updated on existing features along with helpful tips and tricks!

By continuing, I accept Privacy Policy and T&C
Mail Box