Fott (Filter on the table), is a jQuery plugin that adds a <input type="text">
element to <th>
selected.
It searches for inner html of an element with .filter-value
and compare with inputted value.
It was tested with 3000 rows, but it is safer to use below than 1000, depending on the number of columns.
As a jQuery plugin, you must include jQuery 1.7.0+ to your project then include fott.
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="js/fott.min.js"></script>
To active input fields, you should select a <th>
and set fieldFilter
value to cell class that has the expected value:
...
<body>
...
<table>
<thead>
<th class="filterid">ID</th>
<th class="filtername">Name</th>
</thead>
</table>
...
$('.filterid').fott({fieldFilter: 'account-id'});
Fott will then search for a <td>
with class="account-id"
Finding the cell, Fott will then search for a element with class="filter-value"
. The inner value of this element will be used for filtering. You can also set the <td>
itself with class="filter-value"
, such as:
<td class="account-name filter-value">Some value</td>
NOTE: Fott wraps the new <input>
with a <div class="filter">
. I suggest you to include the css file as well, although it is not essential for fott.
Example 1 - Default settings (No strict, placeholder as <th>
inner value):
ID | Name |
---|---|
1 | Dovexacebuboduv |
2 | Juguvurugagejod |
3 | Hocerotuxevugoc |
4 | Fefevocahehoveg |
5 | Xahahabaxuxudax |
6 | Tafutavegafereb |
7 | Vatetocadacahob |
Example 2 - Strict and placeholder:
strict
propriety will force to match only exact content.
placeholder
propriety will overwrite default placeholder.
ID | Name |
---|---|
1 | Wrex |
22 | Garrus |
31 | Obi-wan |
42 | Erl |
58 | Dovahkiin |
66724 | Tafutavegafereb |
00758 | Vatetocadacahob |
Example 3 - Big table, custom input class:
inputClasses
can contains any classes you want to add. In this case, form-control
and input-md
ID | Name |
---|---|
1 | Dovexacebuboduv |
2 | Juguvurugagejod |
3 | Hocerotuxevugoc |
4 | Fefevocahehoveg |
5 | Xahahabaxuxudax |
6 | Tafutavegafereb |
7 | Vatetocadacahob |
8 | Heruhuhebevedur |
9 | Vudaferocuvuroc |
10 | Cogeruvoxahovat |
11 | Vejegohucaxexeh |
12 | Cahebehofuxejuc |
13 | Huragoxecedebev |
14 | Hucecevuhobaruf |
15 | Huxehoxeradubux |
16 | Caregobuduxafov |
17 | Tohugacacuhodac |
18 | Vuruvuhurodagec |
19 | Guboratujorucag |
20 | Ragocucoxotujoh |
21 | Rehogufaratudud |
22 | Vevucehexarurax |
23 | Buvadahavofatoj |
24 | Cerocudebaxefuj |
25 | Texorotedojofaf |
26 | Robajafuvacoveb |
27 | Debuhavudadaboj |
28 | Begudecafuducog |
29 | Vohudavudehatug |
30 | Gahegoxocexurog |
31 | Vufereceruvoged |
32 | Vajetagebahogoh |
33 | Hedevaxojevotuf |
34 | Dojefavaterofec |
35 | Heborobotuhehor |
36 | Dofucecoxejugab |
37 | Voxaxagarugetar |
38 | Bororudodotajac |
39 | Fudojobujocugec |
40 | Redejefocejacev |
41 | Jajuxurecadehef |
42 | Gajujaxuxocevot |
43 | Fofevecahurufov |
44 | Cahaxuhuvucedat |
45 | Cetuduxetujagaf |
46 | Robubuxefofojeh |
47 | Xaderutefebeveg |
48 | Cedorafarofojeg |
49 | Fufebabuhetaceg |
50 | Jotabufabefored |
51 | Cuhorexuxucatat |
52 | Xarevohevoguheh |
53 | Fefevocotabohod |
54 | Fuvevavocecoduv |
55 | Bocejufodavacab |
56 | Gujofocujogegog |
57 | Rabofoveraxadeg |
58 | Vefutuxohofuxuv |
59 | Xotojatuxahefuf |
60 | Bugavafedovojev |
61 | Hovurotohogaduh |
62 | Bugohudugovogot |
63 | Jedahocajotodet |
64 | Daradobuhuteguc |
65 | Tahefubotafahog |
66 | Gobacuxacaverac |
67 | Dudoverebubegoh |
68 | Xegoxofojederuc |
69 | Hegafuhorudagod |
70 | Fecofovaboducuh |
71 | Tejajavofurujuc |
72 | Boroxurocotejur |
73 | Fuxabogebutovux |
74 | Cabevohubecuxah |
75 | Tadafevagafuret |
76 | Xagarehuvafajug |
77 | Tegocafoxexofuj |
78 | Gabaxacoxuvudag |
79 | Fexebojuberavub |
80 | Foboxorexefegab |
81 | Botofacuroxobut |
82 | Bohucededoredud |
83 | Tujorubacebohev |
84 | Hohefubuxaxedoh |
85 | Xuduxovahevuhoj |
86 | Huvocahehevefuc |
87 | Jubutedexehatur |
88 | Hehacoxacaxexox |
89 | Rorafocobedugut |
90 | Jevebuxecudacef |
91 | Vahejurodexuhud |
92 | Rucaxahufavuxaj |
93 | Roxegugovagurag |
94 | Rurejavetuboxex |
95 | Tacoxubagegeduc |
96 | Vegoxavetebefux |
97 | Gajodofeburofuf |
98 | Hutugehacurocej |
99 | Burubecadoguhex |
100 | Fofaxavodecohor |
101 | Jehejefebaxavef |
102 | Tetefohudojatef |
103 | Xuxocafutuhejog |
104 | Xaxofegetototed |
105 | Racafecogofacug |
106 | Cetujufafoxureg |
107 | Gafavarocevevux |
108 | Cerejetavuvevoj |
109 | Juredoxugufuvuj |
110 | Recabavogagoxax |
111 | Fovobacotebogox |
112 | Tofarexecejabor |
113 | Tatefuvubatubuc |
114 | Jodudojexogojex |
115 | Xerajatagetodoj |
116 | Cebabafujojaveg |
117 | Tutubojecugajex |
118 | Tufebofajodudov |
119 | Texutuxevuharer |
120 | Gegugarececubod |
121 | Jahejogefaxedeb |
122 | Gerobehovefutut |
123 | Gafogubutovaber |
124 | Cubujehevefubat |
125 | Raxegagefucavuf |
126 | Cocedaguvoboceg |
127 | Behetabururutav |
128 | Guretagegefefoc |
129 | Juherahejehufaf |
130 | Tugahohafahofux |
131 | Doruvohofajujoj |
132 | Fuvotugorucevor |
133 | Cadagofavevabuv |
134 | Xegefacocoguget |
135 | Fufetebovexafej |
136 | Hafexegotorereg |
137 | Xoxagohocarorur |
138 | Jufafotorujerud |
139 | Cagojufovofutof |
140 | Retodufuvoterob |
141 | Hohodojadofobug |
142 | Rudutufefaracoc |
143 | Xujacejogufedah |
144 | Xuxutevateforuj |
145 | Xobabefafavejev |
146 | Havucebovoguvej |
147 | Fecagucetodujeh |
148 | Rexahevabovegoj |
149 | Vecoxorafuceruv |
150 | Vofexejejudobef |
151 | Taxojotudovufaj |
152 | Hexurojajebaxox |
153 | Revovovuhatahac |
154 | Jucavugocohotoc |
155 | Jejogavodofoxar |
156 | Jatofabacohobaf |
157 | Gahaturofedadav |
158 | Fevocucerejoxob |
159 | Tucuragogehuvar |
160 | Hahahujuguxedec |
161 | Budedoduravebux |
162 | Bagaturagebehof |
163 | Cucodavoteharaj |
164 | Vegabojurecutud |
165 | Batoxorabajarad |
166 | Jebugovurebohab |
167 | Hehojajadufadef |
168 | Cexocurejuxocav |
169 | Xuxubefehojabug |
170 | Ravufafovedajar |
171 | Rohajadadarecah |
172 | Fejugerehohocad |
173 | Caguboruxebutog |
174 | Texadafuvurejah |
175 | Xategovoborexat |
176 | Bofedafuhocetov |
177 | Fuxaxofuxevoxar |
178 | Torohaxexecovah |
179 | Raguducafuhoror |
180 | Vetecutaharedab |
181 | Jajedaxotohedot |
182 | Buhovagetadurur |
183 | Cujafajojegobah |
184 | Tutoxejevejatoc |
185 | Vuhuxocobebafad |
186 | Xuregucohobehef |
187 | Vadujutuxujecoh |
188 | Bujocufujobafev |
189 | Fofedobufucoduv |
190 | Dacefofoxotoced |
191 | Vatugahugararof |
192 | Cexoxeruruhugox |
193 | Tejojurogefacuj |
194 | Retocefetodaxav |
195 | Rerocagorojahej |
196 | Hufuhajohotahaj |
197 | Taxogavatuvecuf |
198 | Jaxagavehojovob |
199 | Dudoceverovaxug |
200 | Radujexucexadoh |
201 | Fobebehohaxegoh |
202 | Jucubabagotudaj |
203 | Darefavetetucat |
204 | Rubabocahabatad |
205 | Tuhebegefojodav |
206 | Cexavofurufuguh |
207 | Tedogobojuvofuc |
208 | Jabuxodohebogud |
209 | Xarabutufujuvuv |
210 | Vehogutubovegeh |
211 | Xevahovurejutob |
212 | Xafufuvoterebog |
213 | Dadogahofacahuv |
214 | Baxohajocatufob |
215 | Dudegujojafofed |
216 | Cefucaxoveruxoh |
217 | Furedevajevuhob |
218 | Judugadoxexojuj |
219 | Ruravavorujevec |
220 | Hujujagacajucut |
221 | Xefuburuxejugub |
222 | Xetevodadovoxed |
223 | Tegabacufucedag |
224 | Ravuxucuvavojoj |
225 | Rexeturugodecex |
226 | Tecubejuxudefag |
227 | Fotufahobarefar |
228 | Johufaxehagoxed |
229 | Bevaxotudedutat |
230 | Tabaxogubexugag |
231 | Hududuhacuxocet |
232 | Joxarujujuxobob |
233 | Cecujehedureheg |
234 | Borufuroterabaf |
235 | Faxafedecefafov |
236 | Xuhecagahojotoc |
237 | Cofaboxedetexar |
238 | Tobegufujexedar |
239 | Goguvugofocohoj |
240 | Jobobobecadacar |
241 | Caraxabobuvufuj |
242 | Botavorohudoteb |
243 | Rahuxufaregexoj |
244 | Buberarehuhaxur |
245 | Bacotaxofuratob |
246 | Raxorudutexofeg |
247 | Cuxafugobajurar |
248 | Doxaroborefuxab |
249 | Xovurubedubuvog |
250 | Raxevejejejevex |
251 | Robofojerucudud |
252 | Hofocejodacebec |
253 | Joreratutoteduh |
254 | Vabetarufeverav |
255 | Bubahogahavutud |
256 | Haguvehavegavev |
257 | Vudofujexegadad |
258 | Hehodovacadujef |
259 | Xeherodejuvobor |
260 | Tatujufofocaxax |
261 | Curafegedocadof |
262 | Tahufovecarahod |
263 | Harovevegubared |
264 | Cefedababocudac |
265 | Hovajaxaxocuhef |
266 | Tetugodotodudub |
267 | Cofuvevajabojej |
268 | Ruxecujovujabet |
269 | Vuvebexejuxafeb |
270 | Boguxubudogehur |
271 | Xarucefucebodaf |
272 | Tevobuvojatufut |
273 | Hobexadubacaxoh |
274 | Caxaceturufafoh |
275 | Toregagutuvatug |
276 | Jecojoberodutax |
277 | Dacavutocecuxex |
278 | Huvuhohejogehoh |
279 | Fohuvajugevotej |
280 | Gutogagajotugev |
281 | Fahodobohoxovub |
282 | Dohovoratojadah |
283 | Hobocevodecaxuv |
284 | Facoxavojugubod |
285 | Garovovofofacag |
286 | Fovuvegocuxetat |
287 | Hocerobafojebub |
288 | Guvadocegofafuj |
289 | Fadurafuguxeguc |
290 | Redurecehaxeget |
291 | Gafebegevohoboj |
292 | Hoxerutedurefoh |
293 | Texovogugebedof |
294 | Geruvucuxejegax |
295 | Xegufehobuxafeh |
296 | Ruhoxabefavureb |
297 | Defogegaxojacag |
298 | Jebefojuroduref |
299 | Tutudugotegugor |
You can download compressed or uncompressed versions of fott:
You can also download, clone and contribute with fott at GitHub
Sets if content must be exactly as typed or if must only contains the value
One or more classes of input's wrapper.
Example:wrapperClasses: 'beautiful-wrapper wrapper wrapping'
Avoid to set any value containing filter
. Eg: filter-field
, filter-wrap
.
One or more classes of input field. This classes will be applied to all inputs.
Example:inputClasses: 'form-control input-medium no-shadow'
Avoid to set any value containing input-fott
. Eg: input-fott-md
, big-input-fott
.
Sets which class identify <td>
that has an element with filter-value
as class, or <td>
itself for future searching and comparison of value.
fieldFilter: 'account-name'
Would match:
<td class="account-name filter-value">Obi-wan</td>
<td class="account-name"><a href="#" class="filter-value">Obi-wan</a></td>
<td>
Sets input's placeholder.
Example:placeholder: 'Looking for a jedi?'
Would produce:
<input type="text" class="input-fott" data-fieldfilter="account-name" placeholder="Looking for a jedi?">
<table>
element of selected elementSets a <table> element to provide navigation through rows and cells. By default, fott considers you are using a structure like:
<table>
<thead>
<th>Header 1</th>
<th>Header 2</th>
</thead>
...
</table>
If you use a different heading structure, you should manually set the <table>
element here. Even so, table must have <tbody>
or fott won't be able to navigate between rows and cells
table: $('.table-striped')