Row Filtering

For sites that need to show many “small” tables with the same structure, e.g. entries from an inventory database, it can be beneficial to keep all rows in one “big” table, to simplify maintaining and editing the data.

Feature description

While manually hiding rows, even with configuration parameters, allows showign only a subset of all table rows, this approach can be cumbersome, as the numbers of the table rows need to remain the same. If a row would move, e.g. because more are inserted in a table, this will cause a lot of extra work.

Therefore, an approach similar to a database select query can help, so that only rows with a certain keyword in a column are shown, instead of the full table. That’s the use case for which the Row Filtering feature module can be used.

Basic example

Imagine having a long table, e.g. a contacts list, with names, birthdays, companies, etc. of many people. The Row Filtering module allows to show only a subset of those people, here e.g. those from a specific company:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7
MoranAugust07/04/1986Cisco651-121460737India$22.6417.5
BuckleyStone09/11/1980Cisco422-799874057United States$30.0127.9

Logic operators

The example above shows the filtering for a single filter term (a single company). Using logic operators, || (for “or”) and && (for “and”), it is possible to search for multiple filter terms. This example uses the || operator to show contacts from two different companies:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
CainLawrence05/16/1994IBM701-310898004United States$54.8152.5
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7
LoganShay09/13/1968IBM687-648203023United States$46.3987.6
MoranAugust07/04/1986Cisco651-121460737India$22.6417.5
BuckleyStone09/11/1980Cisco422-799874057United States$30.0127.9

Similarly, this example shows a table that uses the && operator to show contacts from a certain country and company:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7

Important note: For technical reasons, mixing the logic operators in the same table is not possible!

Additional settings

The filtering of rows can be further controlled using additional settings:

  • It is possible to specify which columns should be searched for the filter terms. By default, all columns are searched.
  • It is possible to select case-sensitive filtering. By default, case sensitivity does not matter, so that both upper- and lower-case matches would be found.
  • it is possible to turn on “Full cell matching”. The default behavior of the Row Filtering is to search for the filter terms anywhere in the cells. This could mean that e.g. the word car is found in a cell with the text shopping cart. Therefore, for some applications, it might make sense to only search the full cell content for matches.
  • In addition, it is possible to invert the “show matching rows” behavior into a “hide matching rows” behavior. This will result in the table only showing those rows that do not fulfill the filtering condition.

Usage instructions

To use these features with your tables, activate the “Row Filtering” feature module on the “Modules” screen of TablePress Pro or TablePress Max. Then, configure the desired options in the “Row Filtering” section of the “Settings” sidebar of the table’s “TablePress table” block when editing the post or page with the table, or use the configuration parameters from below.

The available settings for the Row Filtering module in the "Settings" sidebar of the "TablePress table" block.
The available settings for the Row Filtering module in the “Settings” sidebar of the “TablePress table” block.

Configuration parameters

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

ModuleSlugConfiguration parameterNameDescriptionTypeDefault value
Row Filteringrow-filteringfilterRow Filtering TermThe table will show only rows that contain this filter term. You can combine multiple filter terms with an AND or OR operator, e.g. “term1&&term2” or “term1||term2”.string"" (empty string)
Row Filteringrow-filteringfilter_case_sensitiveRow Filtering Case-sensitive matchingWhether the case sensitivity of the filter term has to match the content in the cell.boolean (true or false)false
Row Filteringrow-filteringfilter_columnsRow Filtering Filter columnsThe columns which should be searched for the filter terms.string"" (empty string) // “” equates to ‘all’.
Row Filteringrow-filteringfilter_expressionRow Filtering ExpressionA logic expression for complex Row Filtering.string"" (empty string)
Row Filteringrow-filteringfilter_full_cell_matchRow Filtering Full cell matchingWhether the full cell content has to match the filter term.boolean (true or false)false
Row Filteringrow-filteringfilter_inverseRow Filtering Invert filtering resultWhether rows with the filter term will be hidden and rows without the filter term will be shown.boolean (true or false)false
Row Filteringrow-filteringfilter_url_parameterRow Filtering URL parameterInstead of, or in addition to, using a pre-defined filter term, a URL parameter like “table_filter” can be used.string"" (empty string)