While working on a project few days back, I came upon a requirement to make html tables look pretty and for that I created a function in jQuery to style a table by calling that function on a given table. Later I thought of converting that function into more usable piece of code – a jQuery plugin and I introduce the StyleTable jQuery plugin.
.
.
.
Using the plugin is as simple as this one line of code:
$('table').styleTable();
Off course, you can also apply the StyleTable plugin based on table classes or ids or even their attributes. See the plugin documentation for more information and examples.
See the plugin in action along with documentation
Download TableStyle Plugin With Examples
.
Quite useful….nice work
@Mohit Jain: Thanks Mohit
Great work can this be extended to have the clicked row highlight instead of the just on mouseover.
Sure you can use the click event instead of hover but then you will have to account for re-enabling/restoring the original settings of the particular row/column
Thanks. I was actally intetedted in keeping the hover event but wanted to extend it to have a row highlight when clicked. However, if you clicked another row the first row clicked would unhighlight and the new row clicked would now be higlighted.
Thanks again for posting.
Very useful thanks!!