jQuery.FilterTable Minimum Rows Sample

← More samples

This is a sample of the jQuery.FilterTable plugin which illustrates the minRows option.

Example 1: Mininum Rows Default (8)

By default, the plugin will add filtering only to tables with at least 8 rows in the tbody. In this example, the table has more than the minimum rows, so filtering is added.

Fruit Mesocarp Color(s) When Ripe
AvocadoGreen
BananaYellow
Dragon fruitPink, White
GuavaPink
Lilikoʻi (Passion fruit)Orange, Yellow
LycheeWhite
MangoOrange, Yellow
PapayaOrange, Red, Yellow
PineappleWhite, Yellow
Star fruitGreen, White, Yellow

Code

$('.example-1').filterTable();

Example 2: Mininum Rows Default (8) on a Small Table

By default, the plugin will add filtering only to tables with at least 8 rows in the tbody. On a table with fewer than this minimum, no filtering is added.

Fruit Mesocarp Color(s) When Ripe
AvocadoGreen
BananaYellow
MangoOrange, Yellow
PapayaOrange, Red, Yellow
PineappleWhite, Yellow

Code

$('.example-2').filterTable();

Example 3: Mininum Rows 0 on a Small Table

Setting the minRows option to 0 will always add filtering to a table, no matter how many rows the tbody contains.

Fruit Mesocarp Color(s) When Ripe
AvocadoGreen
BananaYellow
MangoOrange, Yellow
PapayaOrange, Red, Yellow
PineappleWhite, Yellow

Code

$('.example-3').filterTable({
    minRows: 0
});