SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can I have a coloured table border without the cell borders taking it on?

    In DW (slap me I was using design view) I applied a thick, coloured border to a table. This looked the way I wanted it but for the pesky cells which decided that they wanted to be in on the act and took on similar coloured borders.

    Is there a way to have a border round the table without this happening? I went into the code but didn't see anything obvious.

    Any advice greatly appreciated,

    M

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Apply the border to the <table> element. There's no reason that should be inherited by the <td> elements inside that table.

  3. #3
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've had another look and as far as I can make out it should work if this is what you mean:

    HTML Code:
      <table width="500" border="15" align="center" cellpadding="0" cellspacing="5" bordercolor="#99FF99" bgcolor="#CCFFCC">
    ...but it doesn't.

    Since I've been phping for ages, well a couple of weeks, i've not been using design view but could this be one of the instances when you should make changes in the code from the start rather than alter things in design view? am I getting confused? i seem to remember having to do something that way round before.

  4. #4
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dan, I'd show the whole table but I haven't cleaned out DWs little extras yet,and i'd be embarassed. hey, it took guts to admit using design view. but this is why I like sitepoint - being surrounde by hand coders makes you feel safe.

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ugh, Dreamweaver doesn't write CSS for you? It writes old presentational HTML? I'm outta here.

  6. #6
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'll get round to the css when i've stopped playing around with this little table. anyway, i added

    HTML Code:
    style="border-color: #99FF99;"
    ...and now the border is bevelled or shadowed or something - not flat. as are the <td>s

  7. #7
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perhaps i should be a grown-up and create a style for this table but it'll wait for the morning. up at six and it's already 12.20am in east mare nostrum.

  8. #8
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Something like:

    ...

    table {
    border-style: solid; border-color: #ff0000; background-color: #ccffcc;
    }
    td {
    border-style: solid; border-color: #0000ff;
    }

    ...

    <table width="500" border="15" align="center" cellpadding="0" cellspacing="5">
    <tr><td>1</td></tr></tr><tr><td>2</td></tr></table>

  9. #9
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hephaistion View Post
    i'll get round to the css when i've stopped playing around with this little table. anyway, i added

    HTML Code:
    style="border-color: #99FF99;"
    ...and now the border is bevelled or shadowed or something - not flat. as are the <td>s
    Nope that's wrong :-)
    The examples on this page may help:
    http://www.dreamweaverresources.com/...ableborder.htm

    Nadia

  10. #10
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanyou xhtmlcoder and Nadia P, sorry for not getting back sooner.

    M


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
  •