Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Location
    UK, England
    Posts
    268
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Creating simple border around outside of table only

    How can I create a border around the outsite (only) of a table. All other lines within the table should remain 0 in width.

  • #2
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like this:

    Code:
    <html>
    <head>
    <style type="text/css">
    table {border: 1px solid red}
    td, tr {border: 0}
    </style>
    
    </head>
    <body>
    <table>
    <tr>
    <td>
    Something here
    </td>
    </tr>
    <tr>
    <td>
    Something here
    </td>
    </tr>
    <tr>
    <td>
    Something here
    </td>
    </tr>
    <tr>
    <td>
    Something here
    </td>
    </tr>
    </table>
    </body>
    <html>
    It's jsut setting the border to apply to the table, then cancelling it out for the individual trs and tds.

    Kind regards,

    Gary

  • #3
    Regular Coder
    Join Date
    Apr 2006
    Location
    UK, England
    Posts
    268
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Isnt there an ediatble option in DW for this feature?

  • #4
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts
    uh, well you could always use the DW CSS Panel

    But it'd probably take at least twice as long as simply cutting, pasting, and adadpting the code I just provided.

    Also, if you wanted a specifically DW way of doing it, you should have stated so in your original post, and saved me 2 minutes of valuable time typing that code up

    Kind regards,

    Gary

  • #5
    Regular Coder
    Join Date
    Apr 2006
    Location
    UK, England
    Posts
    268
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Im not very good with codes, so both options wont seem to work for me. it might take some time for me to get a grip of, until then Im going to finish designing the rest of the page.

    The code wasnt a waste of time, at least now i know what its supposed to look like. It will probaly help someone else...

  • #6
    Regular Coder
    Join Date
    Mar 2005
    Location
    D0u$h!t3 k4?
    Posts
    512
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Easy CSS:
    Code:
    table {
    border: 1px solid #000;
    }
    
    table table { /* keep nested tables from having borders */
    border-width: 0px;
    }
    PHP Code:
    $hello file_get_contents('hello.txt'); echo $hello
    hello

  • #7
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by J1mmy View Post
    Im not very good with codes
    Heh, join the club

    As a quick fix, you could define a class using the DW CSS panel, and maybe call it, er, '.borderless' ?

    then:

    Code:
    .borderless { border: 0; }
    You should then be able to select any cell within a table and apply the .borderless styles to it.

    Hope that makes sense, or at least gives an idea - it's been a while since I used DW.

    Kind regards,

    Gary


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •