PDA

View Full Version : Alternating row colors


BoInG
02-14-2006, 10:32 PM
It is possible to add alternating row colors to links listing page?

Boby
02-14-2006, 10:47 PM
Content visible to registered users only.Sure!

Go to your "link.tpl" file, and find:Content visible to registered users only.
Edit the table tag like this one:Content visible to registered users only.
And add to your CSS file (default is main.css)
Content visible to registered users only.
Or whatever you like.

Boby

BoInG
02-15-2006, 12:24 AM
Tnq for your fast reply :D It's working 8)

Mai pe romaneste - ms pentru ajutor :D

lostndazed
04-11-2007, 02:18 AM
Okay, I'm at wits end here. This should be so-o-o simple.
The background color is not showing up in alternate the alternate tables.

I've added this to my main.css file in templates/Default/style

Content visible to registered users only.

And to isolate the problem, I created a testCSS.htm page. Here's the code:
Content visible to registered users only.

Couldn't get that to work, but I could see that the text had been formatted, probably arial size 10 or so. So to test further, I modified this code in the css file:

Content visible to registered users only.

The text is a large red font, but no background color.
So I looked up background color in CSS.

Well, for the span property, it is written a bit differently (can't find an example for table background colors in CSS in my book).

So I tried this:

Content visible to registered users only.

The text became black and shrunk back down. But the background still looks white.

My CSS file is the default CSS file. This is driving me totally nuts. Since everything else works, why doesn't my alternating background color show up? So in desperation, I tried making the background color black.

Content visible to registered users only.

Guess what? That works. So here's my lesson to others.

Choose a different color for the background than #F8F8FC !! (It is too white to show a difference against white backgrounds.)

**goes off to take some aspirin**

searchangle
05-21-2007, 03:45 AM
How would you do this if you converted the table into a div? My current code shows:

<div style="padding:5px; margin:5px; border-top-style: dotted; height:200px; border-top-color: #CCCCCC; border-top-width: 1px; cycle values:odd,even;">

You can see that I tried adding it like the above but dont know the css for this.......

Mr_Bill
08-27-2007, 07:40 PM
Thank you for this worked out great

pnoden
08-27-2007, 09:52 PM
Content visible to registered users only.

You would need to add the class="{cycle values="odd,even"}" to the div like this:
Content visible to registered users only.

Then add the classes .odd and .even to your CSS file.

Willy
08-27-2007, 11:37 PM
And what if the <div> is allready styled through the main.css with a class, like <div class="something">?

Boby
08-29-2007, 08:18 PM
You can assign more classes to an HTML element:
Content visible to registered users only.Content visible to registered users only.This DIV would now have the classes "class1", "class2", "class3" and "odd" OR "even" assigned.

You can now style the element in your CSS file by using one of the assigned classes.
If you have a custom styling set for let's say "class1" and now your HTML element has also "odd" or "even" assigned, you can override the settings with:
Content visible to registered users only.You can also use "!important" but probably IE will ignore it :p (bad IE)
Content visible to registered users only.

Willy
08-29-2007, 08:40 PM
Thanks Boby,

What I did was remove the original class from the div and give it the class="{cycle values="odd,even"}. In my .css I added the original properties to .even and .odd. Apparently that works nicely, if I discover any issues later on I´ll restyle using several classes in the same div. I didn´t know that I can apply more than one class to one element.

Boby
08-29-2007, 09:26 PM
Content visible to registered users only.
You can here combine the rules:
Content visible to registered users only.

Willy
08-29-2007, 09:57 PM
I see,

That works nicely, just applied this.

Thanks again and greetings.

dynn
08-31-2007, 02:37 AM
do you have demo for this?