I need to add the following feature to my table:
When the user clicks on a row (selects it), the row is marked with the color #FFCF8B (the same as
With CSS i think you can't do this. You can use jQuery. I wrote fast basic example(but there is more ways how you can do it):
lol
lol
lol
lol
lol
lol
Add to your CSS file this:
tr.clicked {
background-color: #abc;
}
Add this jQuery code:
$('.tab tr').click(function() {
$(this).toggleClass("clicked");
});
When you click on row in your table, jQuery will add background-color for your row, click again, class will be removed.
Hope it helps.