Table color problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ronboulder
    New Member
    • Jan 2009
    • 2

    #1

    Table color problems

    Sorry, I'm new to BYTES.com and posted this first in the articles section....

    When I display this HTML in a browser the colors do not work. This has to be something very elementary, but I am stumped. What am I doing wrong?

    Code:
    <table BORDER=3 WIDTH="500" >
    <tr>
    <td WIDTH="100" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col A</font></b></center>
    </td>
    
    <td WIDTH="150" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col B</font></b></center>
    </td>
    
    <td WIDTH="250" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col C</font></b></center>
    </td>
    </tr>
    <tr><td BGCOLOR=”#FFCC00">Gold</td>
    <td BGCOLOR="#FFCC00">Gold</td>
    <td BGCOLOR="#FFCC00">Gold</td></tr>
    <tr><td BGCOLOR=”#33FF33">Green</td>
    <td BGCOLOR="#33FF33">Green</td>
    <td BGCOLOR="#33FF33">Green</td></tr></table>
  • Nicodemas
    Recognized Expert New Member
    • Nov 2007
    • 164

    #2
    you had some "smart quotes" in your HTML, notice the slant on the quotes on the cells.

    try this:

    Code:
    <html>
    <body>
    <table BORDER=3 WIDTH="500" >
    <tr>
    <td WIDTH="100" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col A</font></b></center>
    </td>
    <td WIDTH="150" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col B</font></b></center>
    </td>
    <td WIDTH="250" BGCOLOR="#FFCC00">
    <center><b><font face="Arial,Helvetica">Col C</font></b></center>
    </td>
    </tr>
    <tr><td BGCOLOR="#FFCC00">Gold</td>
    <td BGCOLOR="#FFCC00">Gold</td>
    <td BGCOLOR="#FFCC00">Gold</td></tr>
    <tr><td BGCOLOR="#33FF33">Green</td>
    <td BGCOLOR="#33FF33">Green</td>
    <td BGCOLOR="#33FF33">Green</td></tr></table> 
    </body>
    </html>

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      you should have a look at CSS, this makes styling much easier (despite that the <font>, <center> and <b> tags are deprecated)

      Comment

      • ronboulder
        New Member
        • Jan 2009
        • 2

        #4
        Thanks!

        Bingo! Thank you very much.

        Comment

        • Nicodemas
          Recognized Expert New Member
          • Nov 2007
          • 164

          #5
          I concur with Dormilich. Make the switch to CSS in the future.

          Comment

          Working...