473,699 Members | 2,433 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tr background-color?

Hi,

Can someone confirm whether it's possible to set the background-color
property in CSS for a table row (<tr>)?

My code is:

table { display: table; table-layout: fixed; }
tr { display: table-row; }
td, th { display: table-cell; }

and...

table { text-align: left; border: 1px solid silver; font-size: 1em;
width: 100%; margin: 2px; }
td { padding: 0.3em; }
tr { border: 1px solid silver; }
tr.darker { background-color: #cccccc; }
tr.lighter { background-color: #f7f7f7; }
th { padding: 0.3em; }

Many thanks,
Matt :)
Jul 21 '05 #1
9 56214
Matt Bostock <ma**@mattbosto ck.com> wrote:
Can someone confirm whether it's possible to set the background-color
property in CSS for a table row (<tr>)?
Indirectly:

tr.classname td{background-color:#aaa}
tr { display: table-row; }
td, th { display: table-cell; }


Specifying default values is normally pointless.

--
Spartanicus
Jul 21 '05 #2
Spartanicus schrieb:
Matt Bostock <ma**@mattbosto ck.com> wrote:
Can someone confirm whether it's possible to set the background-color
property in CSS for a table row (<tr>)?


Indirectly:


Directly too. You cannot see it of course, when the table cells have a
non-transparent background color.
<http://www.w3.org/TR/CSS21/tables.html#tab le-layers>
Jul 21 '05 #3
Not in this case :) I'm using 'body *' selectors at the start of my
stylesheets to reduce browser inconsistencies .

Matt

Spartanicus wrote:
Matt Bostock <ma**@mattbosto ck.com> wrote:

Can someone confirm whether it's possible to set the background-color
property in CSS for a table row (<tr>)?

Indirectly:

tr.classname td{background-color:#aaa}

tr { display: table-row; }
td, th { display: table-cell; }

Specifying default values is normally pointless.

Jul 21 '05 #4
Christoph Päper wrote:
Directly too. You cannot see it of course, when the table cells have a
non-transparent background color.
<http://www.w3.org/TR/CSS21/tables.html#tab le-layers>


Thanks! I'll try that :)
Jul 21 '05 #5
Hi Christopher,

That didn't work for me (I set the td's background-color to
'transparent'). I'm using Firefox 1.04. Am I missing something?

Matt

Christoph Päper wrote:
Directly too. You cannot see it of course, when the table cells have a
non-transparent background color.
<http://www.w3.org/TR/CSS21/tables.html#tab le-layers>

Jul 21 '05 #6
On Thu, 2 Jun 2005, Matt Bostock wrote:
That didn't work for me (I set the td's background-color to
'transparent'). I'm using Firefox 1.04.
I don't quite understand where your problem is. As an example, see
http://www.unics.uni-hannover.de/nht...-alphabet.html
http://www.unics.uni-hannover.de/nhtcapri/screen.css
Am I missing something?


Please adjust your quoting style. Thank you!

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 21 '05 #7
Andreas Prilop wrote:
I don't quite understand where your problem is. As an example, see
http://www.unics.uni-hannover.de/nht...-alphabet.html
http://www.unics.uni-hannover.de/nhtcapri/screen.css


Thanks Andreas I'll give it another shot.

Matt
Jul 21 '05 #8
Andreas Prilop wrote:
I don't quite understand where your problem is. As an example, see
http://www.unics.uni-hannover.de/nht...-alphabet.html
http://www.unics.uni-hannover.de/nhtcapri/screen.css


I'll rephrase my question. Can a <tr> element with a display property of
'table-row' have a background-color set for it?

Many thanks,
Matt :)
Jul 21 '05 #9
Matt Bostock schrieb:
Hi Christopher,


Hello Matze!
<http://www.w3.org/TR/CSS21/tables.html#tab le-layers>


That didn't work for me (I set the td's background-color to
'transparent'). I'm using Firefox 1.04. Am I missing something?


I expected you'd say you're using IE, which has problems in this area.
Firefox should be fine.

In <http://webdesign.criss ov.de/temp/table-layers.html> all cells, where
the first number is odd and the second is even, should have a blue
background. I suppose you miss something in your code, which you didn't
show us (completely).
Jul 21 '05 #10

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

Similar topics

2
10473
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all have the same name and reside in the following physical path structure:
4
9727
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background I built a two column layout with nested navigation and content divs. The background image is centered via "background: ... center;", the divs are centered over it via "margin: 0 auto 0 auto;". The problem I'm having in IE6 is inconsistent...
4
5481
by: Gequina | last post by:
Something goes wrong in my script. I'm all new to it so i don't know much yet. I have a set of buttons. And when you click on either of them, the background image will change. Only it's not working. It works when i click on one, but then when i want to click on another, it's not working. What am i doing wrong? thanks in advance
3
2036
by: ribinha | last post by:
Hi all, I am having problems loading background images on my pages. I have created a css to display the images. It works just fine on my test box, but when I tried on real pages it wont upload any images everythin else displays just fine. I used a table and added a background image to every row. when i call the page it shows that it is preloading images but never displays. I have tried to place the css code on the page itself as well. the...
3
3237
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in question: www.sayatnova.com (I'm sure many of you have seen this before as I've often asked for help). I've come a long way since I first created the site many moons ago and I'm trying to convert it to a (1) Table-less, (2) Frame-less and (3) Validated...
0
2072
by: Jeb Hunter | last post by:
Well, how can I describe this succinctly? I have a page with DIVs that us background images to produce a border effect. It works perfectly well, but I want to make up (for now) 3 different border/background effects. Rather than duplicate the entire chunk of CSS 3 times, I thought "Gee, I should only have to specify the 3 backgrounds (all the other placement directives would be identical). However I must not be correctly specifying the...
3
27213
by: KNDesign | last post by:
I've set a background image to repeat-y and at 100% height. It appears fine when I open the window, but when I resize to a smaller height so that I must scroll down to see the rest, the background image is suddenly gone from the bottom. #background { position: absolute; top: 0px; bottom: 0px; left: 50%;
6
7231
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to display an image. document.images only seems to reference image tags. The collection needs to include background images, input type = image, image maps, css assigned background, etc. Honestly, I am probably not aware of all the possibilities...
1
2448
by: nicky77 | last post by:
Hi, I've created a nav bar using a background image for rollover effects. Everything works as I had hoped, however, for some reason it seems that an area of whitespace (the same size of the background image) is hyperlinked underneath the nav bar. I can't see any errors in the coding below. Any ideas what may be causing this? the page is at http://www.maguiresonline.co.uk/wosis/files/nickysnav.html the html.... <body...
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.