Column Filter Dropdowns

This feature module allows adding filtering dropdown boxes above the table. Each column will get a select box with all possible values from that column.

If you prefer to have such a dropdown field in the table’s header or footer row, check out the Individual Column Filtering feature module.

Feature description

This table shows the dropdowns in use:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
BanksTravis05/04/1969Apple200-432464655Italy$61.1786.6
CainLawrence05/16/1994IBM701-310898004United States$54.8152.5
MiddletonDennis01/10/1992Google580-950180913Spain$24.8345.2
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7
BurgessQuynn09/24/1988Mozilla430-894378965France$16.1382.9
LottLillith12/10/1978Dell587-228988178Australia$30.1217.9
FreemanCheyenne01/28/1981LG396-547314711Germany$49.8216.0
HoustonJorden05/03/1978Adobe970-118296036Canada$47.3121.5
HarrisMerritt12/29/1989Apple160-597725178United States$77.3360.1
GregoryBrynn01/13/1994Adobe663-603991558Spain$90.2498.2
CurryMason03/15/1969Sony115-477887513Australia$21.6856.6
HollandAlyssa06/25/1976Xerox704-497797921Canada$50.3179.5
LoganShay09/13/1968IBM687-648203023United States$46.3987.6
MoranAugust07/04/1986Cisco651-121460737India$22.6417.5
VasquezKelsey03/31/1968Samsung470-735879655Germany$84.0534.5
SteinLawrence10/15/1960Toshiba929-540736044Italy$77.1128.6
BattleWylie01/03/1988Facebook368-227637585Australia$46.37102.8
BookerLogan12/16/1975Apple830-570122074United States$40.7119.0
GilbertChaney06/06/1970Sony132-556089630Canada$78.4591.2
BuckleyStone09/11/1980Cisco422-799874057United States$30.0127.9

It is also possible to configure which columns should get a filter dropdown and in which order these should be shown!

Usage instructions

To use these features with your tables, activate the “Column Filter Dropdowns” feature module on the “Modules” screen of TablePress Pro or TablePress Max. Then, configure the desired options in the “Column Filter Dropdowns” section on the table’s “Edit” screen.

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
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgetsColumn Filter DropdownsWhether to add Column Filter Dropdowns.boolean (true or false)false
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgets_columnsColumn Filter Dropdowns ColumnsColumns for which Column Filter Dropdowns should be shown.string"" (empty string)
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgets_exclude_columnsColumn Filter Dropdowns Exclude ColumnsColumns which should be excluded from getting Column Filter Dropdowns.

This setting is deprecated. Use datatables_columnfilterwidgets_columns instead.
string"" (empty string)
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgets_separatorColumn Filter Dropdowns Filter Term SeparatorString separator, e.g. “, ” that is used to split cell content to get individual filter terms.string"" (empty string)
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgets_max_selectionsColumn Filter Dropdowns Maximum selectionsThe maximum number of allowed selections from each filter dropdown.

Setting this to 1 will turn the dropdowns into classical select fields, that directly show the selection in the dropdown, instead of below it.
string"" (empty string)
Column Filter Dropdownsdatatables-columnfilterwidgetsdatatables_columnfilterwidgets_group_termsColumn Filter Dropdowns Filter Terms GroupingWhether to list the selected filter terms in one common section instead of underneath each dropdown.boolean (true or false)false

Advanced configuration

If you don’t want a dropdown box for every column, you can add another parameter to the Shortcode, with a comma separated list of columns, like

[table id=123 datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns=2,3,4 /]Code language: plaintext (plaintext)

This would add a dropdown box for all columns, except columns 2, 3, and 4.

Note that the column numbers here are meant without those columns that are hidden on the “Edit” screen of the table, i.e. only columns that are visible in the table should be counted when determining these column numbers.

To set a limit on the number of allowed selections per dropdown box, add this parameter:

[table id=123 datatables_columnfilterwidgets=true datatables_columnfilterwidgets_max_selections=1 /]Code language: plaintext (plaintext)

With that, only one value can be selected from each dropdown box at a time. The visitor would have to remove it by clicking on it, before he can select another filter value.

If your filter columns contain a list of possible keywords, e.g. a list of colors (“red, blue, green, yellow”) where filtering should only be done for one color, you can define the separator characters for these keywords, so that the list is split automatically:

[table id=123 datatables_columnfilterwidgets=true datatables_columnfilterwidgets_separator=", " /]Code language: plaintext (plaintext)