set td margin

windows

Guest
can i do something like this using Css??<br />
<br />
css style:<br />
<br />
.mytd {<br />
margin: 0px 0px 0px 5px;<br />
}<br />
<br />
<br />
html code:<br />
<br />
<table><br />
<tr><br />
<td>&nbsp;</td><br />
</tr><br />
<tr><br />
<td class="mytd">I am here</td><br />
</tr><br />
<tr><br />
<td>&nbsp;</td><br />
</tr><br />
</table><br />
<br />
thanks<!--content-->Well have you tried it? Did it work?<br />
<br />
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;<!--content-->no, it doesn't...<br />
i dont know if i miss something or it just cannot works.<br />
<br />
thanks<!--content-->Only works in browsers that support CSS to a good level like Mozilla Firebird.<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head><br />
<title><br />
CSS Table Spacing<br />
</title><br />
<style type="text/css"><br />
/*<![CDATA[*/<br />
<!--<br />
table {<br />
width : 100%;<br />
border : 1px solid red;<br />
border-spacing : 50px;<br />
padding : 25px;<br />
}<br />
td {<br />
padding : 10px;<br />
color : green;<br />
border : 1px solid blue;<br />
}<br />
--><br />
/*]]>*/<br />
</style><br />
</head><br />
<body><br />
<table><br />
<tr><br />
<td>A</td><br />
<td>B</td><br />
</tr><br />
<tr><br />
<td>X</td><br />
<td>Y</td><br />
</tr><br />
</table><br />
</body><br />
</html><!--content-->what exactly do you want it to do?<br />
<br />
margin-left etc work in most browsers<!--content-->
 
Back
Top