Here is the end product. Note, I have only tested this in Firefox and Safari. Update: tested in IE.
So, how do you build it?
First, the behavior:
- The table to be searched has an arbitrary number of columns.
- There is one text box for searching
- Searching is dynamic - start typing and it starts filtering
- When you search, each word you search for has to appear in at least one column in a row, or that row is hidden
- All the words you search for don't have to appear in each column.
It's late, so I'll leave the rest of the details for now.
7 comments:
Works great, except it doesn't search th tags.
I have a table like this:
thead
some th's
/thead
tbody
th scope=row
some td's
/tbody
If I turn the th scope=row into td's it works great. I assume you exclude th tags so it doesn't filter the header, but what about using the thead thead tag instead?
This was really helpful, had to use it to filter a table of chemicals.
I really like your concept with this. I am hoping to use it in an intranet app. I lifted the js and the init stmt directly from your demo....however I find that in both IE and FF not all char's result in a filter. 1-9, j, k, q, v, x, y & z work fine, but no other alphas will initiate a filter. Same result for uc and lc. I note in your example this problem doesnt exist. Any thoughts?
perfect- exactly what i needed for a company intranet page. saved me the time of writing it myself - kudos!
You saved my life with this.
Just so you know than i'm not an idiot or an ass-hole, i'm not pretending i wrote that from scratch :)
sorry bout my bad english.
Greetings from paraguay
awesome script. ridiculously helpful when I needed to make a filter for a company project in Livelink.