By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

CSS Help

P: 1
Hi,
I need a help for You.
i want to apply different color for every rows and how can i do that in CSS.
please help me and provide me code for that.

below i have mention the code of my HTML Page.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Project</title>

<style type="text/css">
h1 {color: #993300}
p {color: #797373; font-family: Verdana ;font-size: 12px;}
</style>
<table width="700">
<h1>Project</h1>

</head>

<body>

<form name="input" action="html_form_action.asp"
method="post">

<tr>
<td width="181"><p>Title 1</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Title 2</p></td>
<td><input type="text" name="user0"></td>
</tr>
<tr>
<td width="181"><p>Project Name</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Client Name</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Role Played</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Duration</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Technology</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Project Description</p></td>
<td><textarea name="user"></textarea></td>
</tr>


<tr>
<td width="181"></td>
<td><input type="button" value="Submit"></td>
</tr>

</form>
</table>
</body>
</html>
Nov 3 '06 #1
Share this Question
Share on Google+
1 Reply


dreamcatcher
P: 16
Hi,
I need a help for You.
i want to apply different color for every rows and how can i do that in CSS.
please help me and provide me code for that.

below i have mention the code of my HTML Page.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Project</title>

<style type="text/css">
h1 {color: #993300}
p {color: #797373; font-family: Verdana ;font-size: 12px;}
</style>
<table width="700">
<h1>Project</h1>

</head>

<body>

<form name="input" action="html_form_action.asp"
method="post">

<tr>
<td width="181"><p>Title 1</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Title 2</p></td>
<td><input type="text" name="user0"></td>
</tr>
<tr>
<td width="181"><p>Project Name</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Client Name</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Role Played</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Duration</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Technology</p></td>
<td><input type="text" name="user0"></td>
</tr>

<tr>
<td width="181"><p>Project Description</p></td>
<td><textarea name="user"></textarea></td>
</tr>


<tr>
<td width="181"></td>
<td><input type="button" value="Submit"></td>
</tr>

</form>
</table>
</body>
</html>
Here you go, use style in either the td or the tr.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  4. <title>Project</title>
  5. <style type="text/css">
  6. h1 {color: #993300}
  7. p {color: #797373; font-family: Verdana ;font-size: 12px;}
  8. .red {
  9.     background: #FF0000;
  10. }
  11. .green {
  12.     background: #009900;
  13. }
  14. .blue {
  15.     background: #003399;
  16. }
  17. </style>
  18. <table width="700">
  19. <h1>Project</h1>
  20.  
  21. </head>
  22.  
  23. <body>
  24.  
  25. <form name="input" action="html_form_action.asp"
  26. method="post">
  27.  
  28. <tr>
  29.       <td width="181" class="red">
  30. <p>Title 1</p></td>
  31.       <td class="red">
  32. <input type="text" name="user0"></td>
  33. </tr>
  34.  
  35.     <tr class="green"> 
  36.       <td width="181"><p>Title 2</p></td>
  37. <td><input type="text" name="user0"></td>
  38. </tr>
  39.     <tr class="blue"> 
  40.       <td width="181"><p>Project Name</p></td>
  41. <td><input type="text" name="user0"></td>
  42. </tr>
  43.  
  44. <tr>
  45. <td width="181"><p>Client Name</p></td>
  46. <td><input type="text" name="user0"></td>
  47. </tr>
  48.  
  49. <tr>
  50. <td width="181"><p>Role Played</p></td>
  51. <td><input type="text" name="user0"></td>
  52. </tr>
  53.  
  54. <tr>
  55. <td width="181"><p>Duration</p></td>
  56. <td><input type="text" name="user0"></td>
  57. </tr>
  58.  
  59. <tr>
  60. <td width="181"><p>Technology</p></td>
  61. <td><input type="text" name="user0"></td>
  62. </tr>
  63.  
  64. <tr>
  65. <td width="181"><p>Project Description</p></td>
  66. <td><textarea name="user"></textarea></td>
  67. </tr>
  68.  
  69.  
  70. <tr>
  71. <td width="181"></td>
  72. <td><input type="button" value="Submit"></td>
  73. </tr>
  74.  
  75. </form>
  76. </table>
  77. </body>
  78. </html>
Nov 5 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.