+ Post New Thread
Results 1 to 4 of 4
Web Development Thread, Setting table properties in CSS in Coding and Web Development; Is it possible to specify the background color of a table in a CSS file? If so, how do I ...
  1. #1

    Join Date
    Sep 2007
    Posts
    181
    Thank Post
    4
    Thanked 2 Times in 2 Posts
    Rep Power
    15

    Setting table properties in CSS

    Is it possible to specify the background color of a table in a CSS file?

    If so, how do I do this?

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Setting table properties in CSS

    CSS

    Code:
    table.foobar{
    background:red;
    }
    HTML

    Code:
    <table class="foobar">
    <tr>
    <td>foo</td>
    <td>bar</td>
    </tr>
    </table>

  3. #3

    Join Date
    Sep 2007
    Posts
    181
    Thank Post
    4
    Thanked 2 Times in 2 Posts
    Rep Power
    15

    Re: Setting table properties in CSS

    Thanks for that.

    Can you specift hex codes for the colours, or is it a case of red, blue, green, etc?

    I assume most browsers won't understand if I type "backround: pale grey with a hint of green" for example!

  4. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Setting table properties in CSS

    Yes you can use hex:

    Code:
    table.foobar{
    background:#758A79;
    }

SHARE:
+ Post New Thread

Similar Threads

  1. Add dummy table to censornet
    By gh256 in forum How do you do....it?
    Replies: 0
    Last Post: 10th December 2007, 02:24 PM
  2. Time table
    By thegrassisgreener in forum General Chat
    Replies: 35
    Last Post: 27th November 2007, 04:39 PM
  3. PHP Loop Table
    By Jackd in forum Web Development
    Replies: 2
    Last Post: 25th November 2007, 12:28 AM
  4. SQL Table Location G&T
    By mark80 in forum MIS Systems
    Replies: 2
    Last Post: 16th May 2007, 12:46 PM
  5. unable to change tcpip properties?
    By browolf in forum Windows
    Replies: 5
    Last Post: 13th December 2006, 12:15 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •