I am a newbie to Jquery so apoligise if this is a silly question
I have seen many ways how to change the background of a table colour but when a certain row is clicked or hovered, however i want to set the background colour of my table to white when the page is loaded.
i.e code i have saw is like below
$(function() {
$('tr').hover(function() {
$(this).css('background-color', '#FFFF99');
$(this).contents('td').css({'border': '1px solid red', 'border-left': 'none', 'border-right': 'none'});
$(this).contents('td:first').css('border-left', '1px solid red');
$(this).contents('td:last').css('border-right', '1px solid red');
},
function() {
$(this).css('background-color', '#FFFFFF');
$(this).contents('td').css('border', 'none');
});
});
Write it down this code and it work when page load…..
where table_id is id of table…..