AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
Row 1 Cell 1 | Row 1 Cell 2 |
Row 2 Cell 1 | Row 2 Cell 2 |
Row 3 Cell 1 | Row 3 Cell 2 |
Row 4 Cell 1 | Row 4 Cell 2 |
Row 5 Cell 1 | Row 5 Cell 2 |
Row 1 Cell 1 | Row 1 Cell 2 |
Row 2 Cell 1 | Row 2 Cell 2 |
Row 3 Cell 1 | Row 3 Cell 2 |
Row 4 Cell 1 | Row 4 Cell 2 |
Row 5 Cell 1 | Row 5 Cell 2 |
Row 1 Cell 1 | Row 1 Cell 2 |
Row 2 Cell 1 | Row 2 Cell 2 |
Row 3 Cell 1 | Row 3 Cell 2 |
Row 4 Cell 1 | Row 4 Cell 2 |
Row 5 Cell 1 | Row 5 Cell 2 |
$(document).ready(function ()
{
$("#demo-table1").css("background-color", "pink");
$("#demo-table1 tr:first").css("background-color" , "blue");
$("#demo-table1 tr:last").css("background-color", "red");
$("#demo-table1 td:first").css("background-color", "#ffffff");
$("#demo-table1 td:last").css("background-color", "purple");
$('#demo-table2 tr:odd').css('background-color', 'yellow');
$('#demo-table2 tr:even').css('background-color', 'gray');
$('#demo-table3 tr:lt(3)').css('background-color', 'yellow'); //first 3 rows. Indexes 0 thru 2.
$('#demo-table3 tr:eq(3)').css('background-color', 'gray'); //row 3 is gray.
$('#demo-table3 tr:gt(3)').css('background-color', 'red'); //row 4-5 is red.
});