Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two tables with separate row styles

Status
Not open for further replies.

mattquantic

Programmer
Mar 28, 2004
196
GB
Hi, is it possible with css to set two different tables styles, which have tr and td styles that are different to the other table's ones.

Then only assign a class to each table and nothing else?

M@?
 
How about this:
Code:
<style type="text/css">
 .MyTable1 {
	border: 1px solid black;
	border-collapse: collapse;
	width: 80%;
 }

 .MyTable1 tr {
	background: #aaaaaa;
 }

 .MyTable1 td {
	font: normal 0.8em Tahoma, Arial, sans-serif;
	color: #cf0415;
	border: 1px solid black;
	padding: 2px;
 }

 .MyTable2 {
	border: 1px dashed blue;
	border-collapse: collapse;
	width: 80%;
 }

 .MyTable2 tr {
	background: #3380e3;
 }

 .MyTable2 td {
	font: normal 0.8em "Times New Roman", serif;
	color: #ffffff;
	border: 1px dashed blue;
	padding: 5px;
 }


</style>

<table class="MyTable1">
 <tr>
  <td>Some content</td>
 </tr>
 <tr>
  <td>Some other content</td>
 </tr>
 <tr>
  <td>Some completely other content</td>
 </tr>
</table>
<br />
<table class="MyTable2">
 <tr>
  <td>Some completely other content</td>
 </tr>
 <tr>
  <td>Some other content</td>
 </tr>
 <tr>
  <td>Some content</td>
 </tr>
</table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top