Connecting Tech Pros Worldwide Help | Site Map

<tr> background

  #1  
Old July 21st, 2005, 03:00 AM
Thierry Schembri
Guest
 
Posts: n/a
Hi !

I'm facing problems with a background image in a table (with IE & Opera), it
works with FF :
the <tr> has a background image, but the background repeats in each <td>

ex :

tr background -> "this is the background"

instead of displaying :

<td>this is</td><td>the backgroud</td>

it displays :

<td>this is</td></td>this is</td>

Is there a workaround to avoid this problem ?

Thanks in advance



  #2  
Old July 21st, 2005, 03:00 AM
Christoph Päper
Guest
 
Posts: n/a

re: <tr> background


Thierry Schembri:[color=blue]
> the <tr> has a background image, but the background repeats in each <td>[/color]

Please provide code.

tr {background-image: url(foo.bar)}

should work.
  #3  
Old July 21st, 2005, 03:00 AM
Thierry Schembri
Guest
 
Posts: n/a

re: <tr> background


Hello, here is the code :

<style>

table.tb tr
{
background: url(mid.gif') repeat-y;
}

</style>

</head>
<body>
<table class="tb">
<tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
</table>

simple isn't it ?

The 'mid.gif' image is an image for the background of each line of the
table.
It works as supposed with Firefox, but with IE and Opera, the image is
repeating for each cell (and if I add : table.tb td
{background:transparent}, there's no background at all with IE & Opera).

Do you see what I mean ?


  #4  
Old July 21st, 2005, 03:00 AM
Seefor
Guest
 
Posts: n/a

re: <tr> background



"Thierry Schembri" <tschembri@hydromail.net> wrote in message
news:42aef07d$0$11685$8fcfb975@news.wanadoo.fr...[color=blue]
> Hello, here is the code :
>
> <style>
>
> table.tb tr
> {
> background: url(mid.gif') repeat-y;
> }
>
> </style>
>
> </head>
> <body>
> <table class="tb">
> <tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
> </table>
>
> simple isn't it ?
>
> The 'mid.gif' image is an image for the background of each line of the
> table.
> It works as supposed with Firefox, but with IE and Opera, the image is
> repeating for each cell (and if I add : table.tb td
> {background:transparent}, there's no background at all with IE & Opera).
>
> Do you see what I mean ?
>
>[/color]

could you not assign a class to the first cell of each row?

table.tb td.pic
{
background: url(mid.gif) repeat-y;
}

<table class="tb">
<tr><td class="pic">cell 1</td><td>cell 2</td><td>cell 3</td></tr>
<tr><td class="pic">cell 4</td><td>cell 5</td><td>cell 6</td></tr>
</table>


  #5  
Old July 21st, 2005, 03:00 AM
Janusz 'Kali' Kaliszczak
Guest
 
Posts: n/a

re: <tr> background


Thierry Schembri napisa³(a):[color=blue]
> Hello, here is the code :
>
> <style>
>
> table.tb tr
> {
> background: url(mid.gif') repeat-y;
> }
>
> </style>
>
> </head>
> <body>
> <table class="tb">
> <tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
> </table>
>
> simple isn't it ?
>
> The 'mid.gif' image is an image for the background of each line of the
> table.
> It works as supposed with Firefox, but with IE and Opera, the image is
> repeating for each cell (and if I add : table.tb td
> {background:transparent}, there's no background at all with IE & Opera).[/color]

try
table.tb tr td {
background: transparent none;
}

AFAIR CSS spec. says that background-color may be set to "transparent",
but background-image to "none".




--
Janusz 'Kali' Kaliszczak
+ pies rasy *jumnik*
=> http://www.deviantart.com/view/18982956/ <= GG#52055
  #6  
Old July 21st, 2005, 03:01 AM
Thierry Schembri
Guest
 
Posts: n/a

re: <tr> background


interesting ... and strange

with <td> background-image set to none :

firefox : cells use correctly the <tr> background without repeating the
image
opera : each cell repeats the <tr> background
ie : no background at all

mmm I just wanted to use css instead of old methods with tables layouts. I
realize it's really difficult to make such trivial things with so limited
features & so uncompatible browsers...


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
margin for <tr> and <td> are not honored Summercool answers 6 November 6th, 2007 05:35 AM
Tables: <tr> difference in Firefox/IE cyrix answers 1 April 10th, 2007 08:46 PM
<TD>, CSS and Firefox matt cook answers 6 July 21st, 2005 12:49 AM
Why doesn't this work with <TR> tags? Monty answers 5 July 20th, 2005 10:02 PM