Click to See Complete Forum and Search --> : set td margin


mogiaco
07-17-2003, 04:59 AM
can i do something like this using Css??

css style:

.mytd {
margin: 0px 0px 0px 5px;
}


html code:

<table>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="mytd">I am here</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

thanks

Hester
07-17-2003, 08:33 AM
Well have you tried it? Did it work?

BTW you can omit the pixels from the margin or any other CSS command when the value is zero. Eg:margin:0 0 0 5px;

mogiaco
07-18-2003, 05:06 AM
no, it doesn't...
i dont know if i miss something or it just cannot works.

thanks

Robert Wellock
07-18-2003, 09:58 AM
Only works in browsers that support CSS to a good level like Mozilla Firebird.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
CSS Table Spacing
</title>
<style type="text/css">
/*<![CDATA[*/
<!--
table {
width : 100%;
border : 1px solid red;
border-spacing : 50px;
padding : 25px;
}
td {
padding : 10px;
color : green;
border : 1px solid blue;
}
-->
/*]]>*/
</style>
</head>
<body>
<table>
<tr>
<td>A</td>
<td>B</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
</tr>
</table>
</body>
</html>

DaveSW
07-18-2003, 10:13 AM
what exactly do you want it to do?

margin-left etc work in most browsers