<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


HOW TO filter columns in a HTML table within any web page

There are multiple ways to filter columns in a HTML table within any web page

1. Google Sheet can be used to scrape tabular data.

For example, by using the IMPORTHTML formula in a cell within Google Sheet it is possible to scrape the tabular data from this Wikipedia article link:
=IMPORTHTML("http://en.wikipedia.org/wiki/Demographics_of_India", "table", 4)
The table referred in the formula is the fourth among the tables on the web page referred by the URL.

Once you have the data within Google Sheet, you can filter by column value (select column header, choose Filter from Data menu) or hide column (select column, choose Hide column from context menu)

Mediawiki, the open-source wiki application that Wikipedia is based on makes it simple to make a table's columns sortable by just including the value "sortable" in the CSS class attribute for that table.

2. Stoyan Stefanov's ReactiveTable bookmarklet can work on any table (that has table header row cells enclosed within a TH tag) within any web pages including those that need to be authenticated. His blog post has instructions on how to use his bookmarklet to act upon tables to sort, filter as-you-type, download the data in CSV and JSON formats.

Labels: , ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment