Table style for even rows : table row « Table Style « HTML / CSS

HTML / CSS
1. Background Attributes
2. Basic Attributes
3. Basic Tags
4. Box Model
5. CSS Attributes and Javascript Style Properties
6. CSS Controls
7. Form Attributes
8. Form Style
9. Form Tags
10. Frame Attributes
11. Frame Tags
12. HTML
13. IE Firefox
14. Images
15. Layout
16. Layout Attributes
17. Link Attributes
18. Link Tags
19. List Attributes
20. List Style
21. List Tags
22. Marquee Attributes
23. Meta Tags
24. Microsoft Attributes
25. Object Attributes
26. Object Tags
27. Reference
28. Style Basics
29. Styles Tags
30. Table Attributes
31. Table Style
32. Table Tags
33. Text
34. Text Attributes
35. Text Tags
36. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
HTML / CSS » Table Style » table row 
Table style for even rows
 




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title></title>

<style type="text/css">

body {
  font-size: 62.5%;
  margin: 5102010%;

}

img {
  border: none;
}

img.prod {
  background: white; 
  float: left;
  margin: 0 7px 7px 0;
  border: 2px solid #FFCC00;
  padding: 1px;
}


.dltprod {
  text-align: right;
}

.dltprod p {
  margin: 0;
  padding: 0;
  font-size: .9em;
  color: #333333;
}


td, th {
  padding: 0.1em 1em;
  border-right: 1px solid #666;

}


td {
  padding: 7px;
}

caption {
  padding: 1em;
}

#shoppingcartTable {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #666;
}

#shoppingcartTable th 
  background: #888 url(th_bkgd.jpgrepeat-x; 
  font: italic 1.5em Georgia, "Times New Roman", Times, serif; 
  padding: .5em 0 .5em 7px;
  text-align: left;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
  text-shadow: #ccc -2px 2px -2px;
   
}

#shoppingcartTable td {
  vertical-align: top;
}

#shoppingcartTable input[type=text] {
  border: 1px solid black;
}

#shoppingcartTable .prodcell {
  width: 70%;
}

#shoppingcartTable .prodcell a {
  font-size: 1.2em;
}

#shoppingcartTable .prodtitle {
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 2px 0;
  font-weight: bold;
  width: 35em;
  white-space: nowrap; 
}

#shoppingcartTable #iteminfo {
  text-indent: -1000em;
  width: 5em;
}

.dltitem {
  margin-top: 1em;
}

tr {
background: #eee; 
}

tr.odd {
background: #ccc; 
}


</style>

</head>

<body>


<form method="get" action="">
<table id="shoppingcartTable" summary="List of products.">
<caption>Shopping Cart Listing - <strong>Subtotal: $99.16</strong>; changed quantities? <input type="submit"  value="Update price(s)" /> </caption>
  <thead>
  <tr>
    <th id="iteminfo" scope="col">Item info</th>
    <th scope="col">Product</th>
    <th scope="col">Qty.</th>
    <th scope="col">Price</th>
  </tr>
  </thead>
  <tr>
    <td class="dltprod">
    <p>Item added on March 222008.</p>
    <a href="" title="Delete this product">delete"</a>
  </td>
    <td class="prodcell">
    <img class="prod" alt="product image" src="u.jpg" />
    <div class="prodtitle"><a href="">this is a text</a></div>
    <strong>U2</strong>
  </td>
    <td>
    <input type="text" value="1" name="qty" size="2" />
  </td>
    <td>
    $9.66
  </td>
  </tr>
  <tr  class="odd">
    <td class="dltprod">
       <p>Item added on March 22, 2006.</p>
       <a href="" title="Delete this product">delete</a>
  </td>
    <td class="prodcell">
    <img class="prod" alt="product image" src="a.jpg" />
    <div class="prodtitle"><a href="">this is a text</a></div><strong>Apple</strong>
  </td>
    <td><input type="text" value="1" name="qty" size="2" /></td>
    <td>$7.97</td>
  </tr>
  <tr>
    <td class="dltprod">
      <p>Item added on March 22, 2006.</p>
      
      <a href="" title="Delete this product">delete</a>
  
  </td>
    <td class="prodcell">
    <img class="prod" alt="product image" src="a.jpg" />
    <div class="prodtitle"><a href=""></a></div><strong>this is a text</strong>
  </td>
    <td><input type="text" value="1" name="qty" size="2" /></td>
    <td>$9.66</td>
  </tr>
  <tr  class="odd">
    <td class="dltprod">
      <p>Item added on March 22, 2006.</p>
      <a href="" title="Delete this product">delete</a>
  </td>
    <td class="prodcell">
    <img class="prod" alt="product image" src="f.jpg" />
    <div class="prodtitle"><a href="">The Other Side</a></div><strong>this is a test. </strong>
  </td>
    <td><input type="text" value="1" name="qty" size="2" /></td>
    <td>$15.98</td>
  </tr>
</table>
</form>

</body>
</html>

 
Related examples in the same category
1. table row with class
2. Set different colors for even and odd table row
3. table row background
4. table row hover
5. stripe table with Javascript
6. Coloring Rows in a Table
7. Selecting cells in row
8. Alternating Row Background
9. Alternating row colors
10. Table with subtotoal row
11. Hiding row
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.