Sat Jan 12, 2013 10:30 pm
<html>
<head>
<title>different colors for table Even- Odd rows </title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(function() {
$('td:odd').css("background-color", "#F4F4F8");
$('td:even').css("background-color", "#F13131");
$('th:odd').css("background-color", "#00FF30");
$('th:even').css("background-color", "#0030F0");
});
</script>
</head>
<body>
<table border="1">
<tr>
<th>Head Data-1</th><th>Head Data-2</th>
</tr>
<tr>
<td colspan="2" align="center">Row-1 Row-1</td>
</tr>
<tr>
<td colspan="2" align="center">Row-2 Row-2</td>
</tr>
<tr>
<td colspan="2" align="center">Row-3 Row-3</td>
</tr>
<tr>
<td colspan="2" align="center">Row-4 Row-4</td>
</tr>
</table>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.