Total members 11895 |It is currently Sat Dec 21, 2024 7:38 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





different colors for table Even- Odd rows and Cells
javascript code
<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>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : different colors for table Even- Odd rows and Cells
 change the style of table cells     -  
 Select odd rows from table     -  
 Table Border Colors for PHPBB3     -  
 Multi colored table rows     -  
 Listing All Rows and Fields in a Table     -  
 two Different background colors     -  
 show Rainbow Colors     -  
 Drawing a triangle with colors     -  
 deal with colors in java     -  
 three rows frameset .     -  



Topic Tags

JQuery Table






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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