Table colors

They have: 10 posts

Joined: Dec 2003

Hello all,
I have a table and I like each angle to have a differnt color.
how do I do that?
can you give me the html code for that?
thansk

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

Is this what you are refering to:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Table Sample</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <style type="text/css">
  <!--
    .tablecolors { border-top-color: #0000FF;
                   border-right-color: #FF0000;
                   border-bottom-color: #00FF00;
                   border-left-color: #FFFF00;
    }
  -->
  </style>
</head>
<body>
  <table border="10" cellpadding="5" cellspacing="2" class="tablecolors">
    <tr>
      <td>Sample Text<br>Goes Here</td>
    </tr>
  </table>
</body>
</html>
'

There may be other ways to do it, and I'm not sure what all browsers will support what (I need to catch up on using styles, I just did this sample from Dreamweaver MX).

-Greg

They have: 10 posts

Joined: Dec 2003

Yup that was it

thanks alot

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

No problem, I was surprised though how the colors didn't come out the shades I expected. Maybe they are limited?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Colours aren't limited for borders, no. You should set the width of the border in the CSS as well...

<style type="text/css">
.tablecolors {
    border-top: 10px solid #00f;
    border-right: 10px solid #f00;
    border-bottom: 10px solid #0f0;
    border-left: 10px solid #ff0;
    }
</style>
'

He has: 1,380 posts

Joined: Feb 2002

color display depends on monitor and graphics card, as well as color settings for the monitor

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.