Results 1 to 5 of 5

Thread: Change background color of table

  1. #1
    Join Date
    May 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Change background color of table

    I'm working with Dreamweaver. I have a frameset; left frame is a table with 13 links listed. I woud like to have the background of the table change when the user clicks on each link so that in new window shows the left frame in a different color and the content of the linked page. In addition, would like the table to change to a diffenet color, ex, link one table- is red, link 2 table - is green. Can that be done? Please tell me how. Thank you.

  2. #2
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Rule number one of web development, Don't use WYSIWYG editors.
    Hand code your work.
    Rule 2: Don't use tables for layout.

    This can be achieved with CSS,
    <table style="background-color:#ff0000;"> red BG.

    <table style="background-color:#00ff00;"> green BG.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  3. #3
    Join Date
    Apr 2007
    Location
    Phoenix, AZ
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Rule number one of web development, Don't use WYSIWYG editors.
    Or at least do all your design in the code view, and just use the image window for some visual feedback. (That's a good way to learn the hand-coding.)

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by boxxertrumps View Post
    Rule number one of web development, Don't use WYSIWYG editors.
    Hand code your work.
    I use dreamweaver but I use the coding view... so its not that they shouldn't use those editors, its that they shouldn't use the design view to "design" they should use it as a preview

    Quote Originally Posted by boxxertrumps View Post
    Rule 2: Don't use tables for layout.

    This can be achieved with CSS,
    <table style="background-color:#ff0000;"> red BG.

    <table style="background-color:#00ff00;"> green BG.
    and CSS is the most effective way to accomplish this yes, but they should use id and class if for this as well and either do them in an internal embedded script in the head tag
    Code:
    <head>
    
    <style type="text/css">
    <!--
    
    table { //Generic Table Background
     background-color: #ffffff;
    }
    table.CLASS { // Background image across for multiple table tags in this page
     background-image: url(host/path.extension);
    }
    table#ID { // 1 instance of this table element that has a background image with a similar color associated incase the picture doesnt show up
     background: #ffffff url(host/path.extension);
    }
    
    // -->
    </style>
    
    </head>
    where classes are for multiple instances within a given page and ids are for ONLY 1 instance inside the page

    or if they are using the styles over multiple pages they should use an external linked file

    Code:
    <head>
      <link type="text/css" rel="stylesheet" href="host/path.extension" />
    </head>

  5. #5
    Join Date
    May 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you.

Bookmarks

Posting Permissions

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