473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Why doesn't this work with <TR> tags?

..rowbackgrnd {
background-color: #E4E4F2;
border-bottom: 1px solid Black;
border-left: 1px solid #E4E4F2;
border-right: 1px solid #E4E4F2;
border-top: 1px solid Black
}

It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.

Thanks in advance for any guidance.

Monty
Jul 20 '05 #1
5 7556
Monty wrote:
.rowbackgrnd {
background-color: #E4E4F2;
border-bottom: 1px solid Black;
border-left: 1px solid #E4E4F2;
border-right: 1px solid #E4E4F2;
border-top: 1px solid Black
}

It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.


What browser(s) have you had trouble with? <tr> elements cannot
contain data; they can only contain <td> or <th> elements. IIRC, some
browsers fail to apply css properties to them because of that. I ran
into this not too long ago. My solution was to apply them to the td
element instead, e.g.,

..rowbackgrnd TD {
background-color: #E4E4F2;
border-bottom: 1px solid Black;
border-top: 1px solid Black
}

I applied the left and right borders to the table instead of td, since
that creates vertical borders inside the table, which you may not want.

table {
border-left: 1px solid #E4E4F2;
border-right: 1px solid #E4E4F2;
}

Note that this will only work if you have chosen border-collapse:
collapse. If you choose border-collapse:separate, there will be gaps
in the table borders and cells. :( Further problem: IE 5/Mac does
not support border-collapse property. Workaround: In the html, add
the attribute CELLSPACING="0" to the table start tag.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2
Monty wrote:

<snip>
It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.


Table rows are magic and don't have borders. You can put the borders on the
cells inside the row though - top and bottom on all, left on the first,
right on the last. Of course you have to collapse the borders or it looks
awful.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #3
In article David Dorward wrote:
Monty wrote:

<snip>
It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.


Table rows are magic and don't have borders.


That is not true. Table rows can't have borders in separate border
modell, but can have that in collapsing border modell.

Borders on tr don't work on IE, even if collapsed border modell is used.

What borders are used in collapsed border modell:
http://www.w3.org/TR/CSS21/tables.ht...ict-resolution

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #4
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.cis.dfn.de>. ..
In article David Dorward wrote:
Monty wrote:

<snip>
It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.


Table rows are magic and don't have borders.


That is not true. Table rows can't have borders in separate border
modell, but can have that in collapsing border modell.

Borders on tr don't work on IE, even if collapsed border modell is used.

What borders are used in collapsed border modell:
http://www.w3.org/TR/CSS21/tables.ht...ict-resolution

Thanks to all who responded. I had tried IE6 and Mozilla 1.5 without
success.

I have a bunch of existing pages that have <TR>s with the
background-color set and I just wanted to change the class definition
so that there would be rules at the top and bottom of the rows. But
it looks like it's going to be too much work to implement.

Monty
Jul 20 '05 #5
Monty wrote on 11 dec 2003 in comp.infosystems.www.authoring.stylesheets:
.rowbackgrnd {
background-color: #E4E4F2;
border-bottom: 1px solid Black;
border-left: 1px solid #E4E4F2;
border-right: 1px solid #E4E4F2;
border-top: 1px solid Black
}

It works for <td> tags but not <tr> tags. I've tried a number of
alternatives but I canlt seem to figure out what I'm doing wrong.

Thanks in advance for any guidance.


try this:

===========================

<style>
..trtdbackgrnd, .rowbackgrnd td {
background-color: #E4E4F2;
border-bottom: 1px solid Black;
border-left: 1px solid #E4E4F2;
border-right: 1px solid #E4E4F2;
border-top: 1px solid Black
}
</style>

<table>
<tr class="rowbackgrnd">
<td>----1---</td>
<td>----2---</td>
<td>----3---</td>
</tr>
</table>

<br>or:<br>

<table>
<tr>
<td class="trtdbackgrnd">
<table>
<tr>
<td>----1---</td>
<td>----2---</td>
<td>----3---</td>
</tr>
</table>
</td>
</tr>
</table>

=============================

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: F. Da Costa | last post by:
Hi, I' looking to retrieve ProdName1 form the <tr> below. <tr id="1-1-1" class="even"> <td> <div class="tier4"> <a href="#" class="leaf"></a> ProdName1 </div>
18
by: Shannon Jacobs | last post by:
Trying to solve this with a regex approach rather than the programmatic approach of counting up and down the levels. I have a fairly complicated HTML page that I want to simplify. I've been able to...
30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
9
by: Wayfarer | last post by:
Hi, I've been developing in Firebird, so I didn't notice this until today. When I use the <q> tag, IE 6 doesn't put quotes around the quotation. I tried specifically doing it in a stylesheet: ...
5
by: Gregor Rot | last post by:
Hi, if i have this code: <form><input type=text name="id1"></form> then with javascript i can reference this with this.form.id1, how can i reference something like this: <table> <tr...
2
by: BrianP | last post by:
Hi, I have had to invent a work-around to get past what looks like a JavaScript bug, the malfunctioning Perl-like JavaScript array functions including SPLICE() and UNSHIFT(). I have boiled it...
3
by: Dunc | last post by:
I have a data list control with 3 columns. I want every second *row* to have a dfferent CSS class. Can someone tell me how to access the parent tablerow, and add a cssclass? I'm guessing I'll...
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.