SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: bordercolor

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    bordercolor

    How can I give a specific cell in a table a bordercolor?

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <table border="1">
    <tr><td style="border: 1px solid red">Text</td></tr>
    </table>
    Something like that.

    Douglas
    Hello World

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok
    so I have to make the border of all the other cells white.

  4. #4
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Rodney
    ok
    so I have to make the border of all the other cells white.
    Code:
     td { border: 1px solid white; }
    .red { border-color: red; }
    HTML Code:
    <table border="1">
    <tr><td class="red">Red</td><td>Text</td></tr>
    <tr><td>Text</td><td>Text</td></tr>
    </table>
    ?

    Douglas
    Hello World

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I put the color also in #...... ?

  6. #6
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guess.

    No, really, give it a try yourself. Does it work?

    Douglas
    Hello World

  7. #7
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it doesn't.

  8. #8
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about rgb colours? Do they work?

    Code:
    .red { border-color: rgb(255,0,0); }
    Douglas

    Sorry for being an a-ss about it, but really.... (a-ss is a censored word????? I know this is an international forum and all... but a-ss? It means donkey!)
    Hello World

  9. #9
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry for not being clear.
    The # is working.
    The problems come when I add class=".." to the "<td>".

    That seems to block the cell. And don't changes the bordercolor.

  10. #10
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    # in a stylesheet denotes an ID not a class. If your stylesheet has #whatever in it, your table cell has to have an id of "whatever".

  11. #11
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tested the example and that seems to work.
    I'm obviously doing something wrong.

  12. #12
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I can't use the #..... .
    I'll try the RGB code.

  13. #13
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rodney: # can be used in more than one place in a CSS file.

    This is a colour, and this is an id selector:

    Code:
    #redcell { border-color: #f00; }
    HTML Code:
    <td id="redcell">red</td>
    hth,
    Douglas
    Hello World

  14. #14
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    rotterdam
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's working now.
    Thanx for the help and the patience.


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
  •