i have two tables. <table id='1'></table>
and <table id='2'></table>
. When i put this code:
$(document).ready(function()
{
//for table row
$("tr:even").css("background-color", "#F4F4F8");
$("tr:odd").css("background-color", "#EFF1F1");
});
Both the tables got it alternate row colors, which i dont want, i want only to color the table with id=2. how it can be accomplished?
Modify your code like:
$(document).ready(function()
{
$("table#id2 tr:even").css("background-color", "#F4F4F8");
$("table#id2 tr:odd").css("background-color", "#EFF1F1");
});
This assumes you have table with id
set to id2
eg:
<table id="id2">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With