tags:

views:

26

answers:

4

how to set table border or table's outside border with some color and size but the cells of the table have border size=0

  ----------------------
 |   -------   ------   |
 |  |   1   | |  2   |  |
 |   -------   ------   |                      
 |                    3 |
  ----------------------
  • container 1 & 2 : which are the cells have border=0
  • container 3 : which is the table itself has border=1 * color = #333333
A: 

This works fine in IE, too.

<table style="border:1px solid red;"> 
<tr>
    <td>1</td>
    <td>2</td>
</tr> 
</table> 
Brissles
A: 
<table style="border: 1px solid red;">
    <tr><td>1</td><td>2</td></tr>
</table>

This works in the newest Firefox and Chrome. Is there any particular browser you're having problem with?

Juliusz Gonera
+1  A: 

Should use CSS IMO

    table#foo {
        border:1px solid #333333;
    }

    table#foo td { 
        // td styles
    }

    //etc

<table id="foo"> <!-- table code -->
Ross
A: 

http://jsfiddle.net/mnzN2/2/

Here's a working example.

Litso