Table Border Setting
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
Should use CSS IMO
table#foo {
border:1px solid #333333;
}
table#foo td {
// td styles
}
//etc
<table id="foo"> <!-- table code -->
http://jsfiddle.net/mnzN2/2/
Here's a working example.
<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?
This works fine in IE, too.
<table style="border:1px solid red;">
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
精彩评论