...

View Full Version : Table shadow & margins?



Extreme43
07-09-2005, 12:49 AM
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

http://host3d.no-ip.com/cp.png

_Aerospace_Eng_
07-09-2005, 01:18 AM
Well you could do this with CSS but that may get extensive if you have many tables

<!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 (http://www.alistapart.com/articles/cssdropshadows/) might explain it better.

Extreme43
07-09-2005, 02:09 AM
ok thanks but how would i set some sort of margin or indent??

_Aerospace_Eng_
07-09-2005, 02:18 AM
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

td {
padding:5px;
}

Extreme43
07-09-2005, 04:00 AM
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)


<table class=shadow1>
<td>
text
</td>
</table>

_Aerospace_Eng_
07-09-2005, 04:04 AM
Why even use a table? What is your purpose of using a table? Are you going to be displaying data?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum