Click to See Complete Forum and Search --> : Padding inside <TD>


sumon177
04-26-2006, 03:41 PM
How can I do Top padding inside a <td>? I need to align an image a few pixel off from the top. I tried padding-top, bottom..nothing works. Any advice..thanks

TiGGi
04-26-2006, 03:47 PM
try applying this style to ur <TD> .paddig {
padding-top: 5px;
}

sumon177
04-27-2006, 07:45 AM
I figured out why it was happening...I had a text box and IMG in same <td>. That was the problem?
I put them different <td> and its been solved...thanks.

TiGGi
04-27-2006, 08:13 AM
works, for me fine, lets do step by step..
1. Copy and paste following css between your <head></head> tags <style type="text/css">
<!--
.paddig {
padding-top: 50px;
}
-->
</style> 2. Add css style to the cell so it should look like this: <td class="paddig">

sumon177
04-27-2006, 08:38 AM
Hi TIGGI..plz see my edited answer earliar. Its been solved..Just want to ask u if I have multiple items in one<td>, i.e, text box, image, text line...I can't padding only image or text box? It will cause padding for all the items in that <td>? Thanks.

pcthug
04-28-2006, 02:53 AM
<style type="text/css">
<!--
.paddig {
padding-top: 50px;
}
.paddig img, p, input {
margin: 25px;
}
-->
</style>
</head>
<body>

<table>
<tr><td class="paddig">

<img src="foo.gif" alt="bar">

<form>
<input type="text" name="foo">
<input type="submit" name="bar" value="submit">
</form>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam arcu orci, auctor vel, tristique vulputate, fringilla a, neque. In pretium porta pede. In hac habitasse platea dictumst. Cras nisl. Nam orci nulla, aliquet ut, lacinia vel, lobortis vel, nisi. Nunc pretium enim id ante. Duis sed elit a nisl facilisis auctor. Aenean tristique sem ac metus. Aenean fringilla eleifend arcu. Suspendisse aliquet massa vitae sem. Fusce imperdiet, ipsum sed venenatis pharetra, eros arcu eleifend leo, ut aliquam nunc purus nec velit.</p>

</td></tr>
</table>
</body>
</html>
I however suggest reading this article (http://www.hotdesign.com/seybold/), as it will give insight to abusing tables.