Home › Forums › Archives › Computer Support › Computer Support Discussion › html help…
- This topic has 5 replies, 4 voices, and was last updated 17 years, 4 months ago by SeanMcGill.
-
AuthorPosts
-
September 3, 2006 at 12:38 am #24800bronxyMember
We wanted to put this into x-cart, or maybe I can just put it onto my site. Either way I dont know if anyone knows how to do this. I did this a looong time ago on my site and literally forget how to do it.
say I post a news post, it will have a grey background to it, and then the next i make maybe will have a red background to it, and it’ll alternate.
We would like that on our website with the xcart so you can differenate between each product. have a light grey background over 1 product, and maybe the other one just plain white. http://www.appliancecenterdirect.com/home.php?cat=508
like the first grill will have a light grey bg, and the 2nd one would have a white plain bg, 3rd picture would be the light grey again.Sorry if I sound confusing. How would I do this? with css, or something else? Thanks for the help.
September 3, 2006 at 2:29 am #151739DangerBoyMemberYou’d do this easiest with css and php. Here’s what I’d do:
In your script find where the rows are being generated and add this above the first
tag: Code:In simple terms this is saying: If the word ‘alternate’ does not equal the value of $class then $class should equal ‘alternate’ else it should equal nothing. Basically it just alternates between a blank class and a class with a value of ‘alternate’. So next you’d need to add this into your
tag like so: Code:<tr class='’>Then in your CSS stylesheet define the background colours for tr and tr.alternate like so:
Code:tr{ background-color:#666666;}
tr.alternate{ background-color:#FF0000;}And that’s all there is to it! Easy right?
September 3, 2006 at 9:26 pm #151740bronxyMemberlooks easy…
I tried to do it and maybe i’m doing something wrong here.I put the code on
http://www.bronxy.com/table2.htmCode:<TR class='’>
Image here Image here Image here data4 Am I doing something wrong that its not working?
[edit] it looks like it kinda works. except it only does the black color for the first one, and then the rest of the same color. it should alternate between colors.
September 3, 2006 at 10:22 pm #151738TigerbladeParticipantyou need to have the <TR class='’> on every TR tag, not just the first one.
September 3, 2006 at 11:14 pm #151741bronxyMemberOkay that worked now.
Thank you both for all of the help!!!! I appreciate it greatly.December 22, 2006 at 7:00 am #151742SeanMcGillMemberif you like to increase your knowledge about HTML then you go for this site
Web Design Company : Home Page
and increase you knowledge. -
AuthorPosts
- You must be logged in to reply to this topic.