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

a border around a row of a table ?

P: n/a
Mel
is it possible to draw a border around a row of a table ?

example please...

thanks
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Els
Mel wrote:
is it possible to draw a border around a row of a table ?

example please...

thanks


table{border-collapse:collapse;}
tr.row td{
border-width:1px 0;
border-style:solid;
border-color:black;
}
tr.row td.left{
border-width:1px 0 1px 1px;
}
tr.row td.right{
border-width:1px 1px 1px 0;
}
<table>
<tr class="row">
<td class="left"></td>
<td></td>
<td></td>
<td class="right"></td>
</tr>
<tr>
.....
</tr>
</table>
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Jul 21 '05 #2

P: n/a
On Fri, 3 Jun 2005 18:32:10 +0200, Els wrote:
Mel wrote:
is it possible to draw a border around a row of a table ?

example please...

thanks


table{border-collapse:collapse;}
tr.row td{
border-width:1px 0;
border-style:solid;
border-color:black;
}
tr.row td.left{
border-width:1px 0 1px 1px;
}
tr.row td.right{
border-width:1px 1px 1px 0;
}
<table>
<tr class="row">
<td class="left"></td>
<td></td>
<td></td>
<td class="right"></td>
</tr>
<tr>
....
</tr>
</table>


I tried the much simpler and more intuitive
tr.row { border: 1px solid black; }
(see http://www.trawna.com/test/rowborder.html for a live example)

It works in Opera 6.04 and 7.23 and Firefox 1.02. Mozilla 1.0 puts a
border across the top and bottom of the row, but not the left and right.
Netscape 6.2.3 and IE 6.0 (and presumably all older versions) don't
display any border at all. I've never been good at reading standards;
is this an area that is undefined, or is it just spotty conformance?

--
Greg Schmidt gr***@trawna.com
Trawna Publications http://trawna.com/
Jul 21 '05 #3

P: n/a
Els
Greg Schmidt wrote:
On Fri, 3 Jun 2005 18:32:10 +0200, Els wrote:
Mel wrote:
is it possible to draw a border around a row of a table ?

example please...

thanks
table{border-collapse:collapse;}
tr.row td{
border-width:1px 0;
border-style:solid;
border-color:black;
}
tr.row td.left{
border-width:1px 0 1px 1px;
}
tr.row td.right{
border-width:1px 1px 1px 0;
}
<table>
<tr class="row">
<td class="left"></td>
<td></td>
<td></td>
<td class="right"></td>
</tr>
<tr>
....
</tr>
</table>


I tried the much simpler and more intuitive
tr.row { border: 1px solid black; }
(see http://www.trawna.com/test/rowborder.html for a live example)

It works in Opera 6.04 and 7.23 and Firefox 1.02. Mozilla 1.0 puts a
border across the top and bottom of the row, but not the left and right.
Netscape 6.2.3 and IE 6.0 (and presumably all older versions) don't
display any border at all. I've never been good at reading standards;


Maybe that's IE's problem too ;-)
is this an area that is undefined, or is it just spotty conformance?


Specs for both CSS 2.1 and CSS 1 state that borders are applicable to
all elements, that would include <tr> imo. So it's just not supported
by IE, and since IE is still being used by a vast amount of surfers, I
use the work around above.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Jul 21 '05 #4

P: n/a
in comp.infosystems.www.authoring.stylesheets, Els wrote:
Mel wrote:
is it possible to draw a border around a row of a table ?

example please...

thanks


table{border-collapse:collapse;}


Well, after above
tr.row {border:2px solid red} is enough.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #5

P: n/a
Els
Lauri Raittila wrote:
in comp.infosystems.www.authoring.stylesheets, Els wrote:
Mel wrote:
is it possible to draw a border around a row of a table ?

example please...

thanks


table{border-collapse:collapse;}


Well, after above
tr.row {border:2px solid red} is enough.


Not in IE.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.