Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5

Thread: colouring

  1. #1
    Senior Member Kayo's Avatar
    Join Date
    Dec 2006
    Location
    Brampton Ontario
    Posts
    416
    Member #
    14523
    Liked
    39 times
    I am useing a table, (for data ofcourse) I am wondering if I could set the background colour for every 4 <td>. Its going to be like this website (the background colour of the song lyrics text), but its for tables.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    22 times
    Not possible with CSS 2.1 and earlier except for marking each of those <td>s, or their parent <tr>s, if appropriate, with classes. CSS 3 includes the :nth-child pseudoclass where theoretically [minicode]td:nth-child(4)[/minicode] would work, but nothing supports it yet.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Man it would be SO sweet to be able to do that. Especially for alternating table rows, GOSH!
    choosy developers choose gif!
    website | paintings | blog

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,980
    Member #
    5580
    Liked
    761 times
    Is your page created by a script (like PHP)? or is it a static webpage?
    If a script is used, you can do just about anything you want.


  6. #5
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    PHP would get the job done, but CSS 3 should save us a lot of trouble. There have been numerous ideas on getting it to work, like this article on ALA.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com