Table Layout

Customize the layout and position of features around a table.

By default, TablePress tables show a page length selector and a Search field above the table and size information as well as pagination controls below the table. These features can be turned off and will then be hidden, but the basic version of TablePress does not support moving these feature controls to a different position around the table.

Feature description

This is now possible with the “Table Layout” feature module! Using a drag and drop interface, you can position the control elements of the Pagination, Page Length Change, Search, and Table Info around the table as desired. It is even possible to insert these controls multiple times!

In addition, all control elements of TablePress Premium feature modules are supported: You can freely choose the position of the control elements for the Alphabet Search, Buttons, Column Filter Dropdowns, Custom Search Builder, and Search Panes feature modules!

Here is an example: Unlike in a standard TablePress table, the Pagination feature is shown above and below this table (which makes most sense in long tables with many rows, of course). The positions of the Buttons, Table Info, Page Length, and Search fields have also be changed.

NameYearCountrySportTimeRateFee
Eric1986SwedenSoccer05:2540.4%$7.14
Julia1991GermanyBasketball04:4520.3%$2.90
Adam2002IndonesiaGolf19:4043.3%$4.40

Usage instructions

To use this feature with your tables, activate the “Table Layout” feature module on the “Modules” screen of TablePress Pro Or TablePress Max. Then, configure the desired positions for the control elements in the “Table Layout” section on the table’s “Edit” screen. You can either drag and drop the individual features, or double-click them to insert them at their default positions or remove them again.

Configuration parameters

To configure this module’s features, you can also use these configuration parameters in the “TablePress Table” block or in the Shortcode that you are using to embed the table:

ModuleSlugConfiguration parameterNameDescriptionTypeDefault value
Table Layoutdatatables-layoutdatatables_layoutTable LayoutThis parameter allows changing the Table Layout, by returning an object in JSON notation, e.g. as datatables_layout='{...}'.
However, as Shortcode parameters can not contain [ or ] characters that denote arrays in JSON, setting a different layout is only possible if only one control element should be shown per feature position.
Due to the JSON requirement, the JSON object string must be wrapped in single quotes ' for WordPress to properly recognize the parameter.
Example: The configuration parameter datatables_layout='{"top":"search", "topStart":null, "topEnd":null, "bottomStart":"paging", "bottomEnd":null}' will move the “Search” field to the top center position and only keep the Pagination controls below the table.
For more details, see the DataTables documentation.
string"" (empty string)