Results 1 to 14 of 14

Thread: Table border colors?

  1. #1
    Registered
    Join Date
    Aug 2003
    Posts
    10

    Table border colors?

    Is there a way to alter a table's border color?

  2. #2
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    Table within a table. Border style is controlled from the top line. Here you'll get a 3 pixel red border:

    Code:
    <table cellspacing="0" cellpadding="3" border="0" width="200" bgcolor="#ff0000">
      <tr>
        <td>
          <table cellspacing="0" cellpadding="10" border="0" width="200" bgcolor="#ffffff">
            <tr>
              <td>
              <br /><br /><br />
              </td>
            </tr>
          </table> 
        </td>
      </tr>
    </table>
    ....

  3. #3
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    CSS.

    You can apply a different border to each side of each <td> and the <table>. Will post an example later if you like, in a rush not tho..

  4. #4
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    Take one cell of your table and do something like this:

    <td style="border: 1 1 1 1 solid black"> stuff </td>

    That will give all the borders of your table cell a 1 pixel soild black border. OR...

    <td style="border-left: 1px solid black; border-right: 1px dotted green;"> stuff </td>

    You can figure out what that one will do.

  5. #5
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    Thanks chromate

    First example should really be:

    <td style="border:1px solid black">stuff</td>



    w3schools has a good description of borders in the CSS section - a resource i use regularly.

  6. #6
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    Yeah, I just wanted to illustrate how you could do:

    <td style="border: 1 10 3 4 solid black;"> stuff </td>

    ... to make each border of the cell a different size, depending on what number is changed. Saves having to write: border-left: 2px solid black; border-right: 4px solid black etc etc

    just a short-cut time saver type thing.

  7. #7
    Registered
    Join Date
    Aug 2003
    Posts
    10
    Great! Thanks so much, guys-I thought it would be something involving CSS, I'm just learninghow it all works. Thanks again.

  8. #8
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    That's pretty nice (although I can't get chromate's example to work in all browsers). I'll check out w3school's css section..
    ....

  9. #9
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    You should always put a unit like "px", "%" or "em", unless its a 0, when the unit doesnt matter. That might be the stumbling block. It wouldnt know whether it was 1%, 1px, 1em or what so might just set it to 0.

  10. #10
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    It defaults to 1px. But technically you're right. My examples aren't "valid". They're for lazy people

  11. #11
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    Originally posted by chromate
    It defaults to 1px. But technically you're right. My examples aren't "valid". They're for lazy people
    Ah ok, is that for all browsers though? I know IE does, but thought his problem must be due to this, as all the rest is valid CSS.

  12. #12
    Registered
    Join Date
    Dec 2003
    Posts
    32
    Multiple embedded tables used to cause serious loading problems in netscape but no-one seems to use netscape anymore so I don't even check it now (after it giving me serious headaches just a few years ago).
    Last edited by Apollo; 01-09-2004 at 02:05 PM.

  13. #13
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    I check sites to make sure they're "readable" in netscape, but don't bother much beyond that. Unless it's a client's site, in which case I'll put in a bit more effort

  14. #14
    Registered
    Join Date
    Aug 2003
    Posts
    10

    Table border

    Still having problems-there's a layout grid, which is also a table, so when I can get a border on the table, I get it on the grid also. I read that I should apply a class to the CSS, but am clueless on how to do that. Also the separations for the cells also need borders. When making any adjustment to the <td> tag, (or any CSS element), should that be done in the head section or in the tags in the html?

Similar Threads

  1. web safe colors?
    By Chris in forum Graphics & Multimedia
    Replies: 9
    Last Post: 05-15-2004, 03:46 AM
  2. Getting the right colors ...
    By mike639 in forum Graphics & Multimedia
    Replies: 2
    Last Post: 04-20-2004, 05:57 AM
  3. table drop downs ?? :s
    By k0r54 in forum HTML, CSS, Layout, and Design
    Replies: 3
    Last Post: 11-20-2003, 09:44 PM
  4. Hybrid colors, anyone?
    By snaip in forum Graphics & Multimedia
    Replies: 8
    Last Post: 11-05-2003, 07:53 AM
  5. Large table and downloading
    By johnn in forum Website Programming & Databases
    Replies: 3
    Last Post: 10-12-2003, 05:53 AM

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
  •