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 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table shadow & margins?

    Hey,
    how would i have a shadow under a table and also set margins or some sort of indent on the table

    like in this picture


  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Well you could do this with CSS but that may get extensive if you have many tables
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    body {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:14px;
    }
    .box1 {
    width:398px;
    height:123px;
    position:relative;
    background-color:#FFFFFF;
    border:1px solid #333333;
    }
    .box1 p {
    margin:0;
    padding:0;
    background-color:#CCCCCC;
    color:#FFA500;
    font-weight:bold;
    text-indent:15px;
    border-bottom:1px solid #333333;
    }
    .shadow1 {
    position:absolute;
    right:-6px;
    top:4px;
    z-index:0;
    width:5px;
    height:125px;
    background-color:#CCCCCC;
    }
    .shadow2 {
    position:absolute;
    z-index:0;
    width:400px;
    height:5px;
    line-height:0;
    background-color:#CCCCCC;
    bottom:-7px;
    left:4px;
    }
    </style>
    </head>
    
    <body>
    <div class="box1">
    <p>New Control Panel</p>
    <div class="shadow1">&nbsp;</div>
    <div class="shadow2">&nbsp;</div>
    This is a preview
    </div>
    </body>
    </html>
    But this article might explain it better.

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks but how would i set some sort of margin or indent??

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You mean a margin or indent to the text inside the td cell? Again CSS, you can make all tds have a padding of 5px or something
    Code:
    td {
    padding:5px;
    }

  • #5
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks
    how would i apply the shadow to a table though

    like the below doesnt work (didnt think it would bt tried anyway)
    i searched google but nothing would work (tried on a mac till i get home)
    Code:
    <table class=shadow1>
    <td>
    text
    </td>
    </table>

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Why even use a table? What is your purpose of using a table? Are you going to be displaying data?


  •  

    Posting Permissions

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