Jump to content

Apply border to all cells in one specific table


arunpatal

Recommended Posts

Hi,

 

The Code below applys background and border to both table.....

i just need it to apply in table1 only..

 

How can i do that?

 

<style>
.table1, td{
   background-color:#999;
   border:dashed 1px #666666;
   width:400px;
   height:200px;
}
</style>
<table class="table1">
<tr>
<td>table1</td>
<td>table1</td>
</tr>
<tr>
<td>table1</td>
<td>table1</td>
</tr>
</table>
<table class="table2">
<tr>
<td>table2</td>
<td>table2</td>
</tr>
<tr>
<td>table2</td>
<td>table2</td>
</tr>
</table>

Ok after.. googling

 

I found that it should work like this

 

<style>
.table1 td {
   background-color:#999;
   border:dashed 1px #666666;
   width:400px;
   height:200px;
}

.table2 td {
   background-color:#CF6;
   border:dashed 1px #C33;
   width:400px;
   height:200px;
}
</style>

<table class="table1">
<tr>
<td>table1</td>
<td>table1</td>
</tr>

<tr>
<td>table1</td>
<td>table1</td>
</tr>
</table>

<table class="table2">
<tr>
<td>table2</td>
<td>table2</td>
</tr>

<tr>
<td>table2</td>
<td>table2</td>
</tr>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.