webmonkey

 

padding-left

Page history last edited by john carello 2 yrs ago

The CSS padding-left property is used to apply padding to the left side of an element. CSS padding is kind of the CSS equivilent to CELLPADDING in HTML (however, CSS padding is more powerful - it can be applied to any element, not just table cells, and as you can see here, a different padding value can be applied to any side you wish). To apply the CSS padding property to table cells you need to apply padding at the cell level (i.e. you style the TD tag - not the TABLE tag).

 

**Syntax: padding-left: <value>;** Possible Values: <padding-width> inherit **Initial Value: 0** Applies to: All elements **Inherited: No** Media: Visual **Example: td { padding-left:50px; }**

<raw>

<style type="text/css">

 td {

 width:50%;

 border:1 solid black;

 }

 td.padded {

 padding-left:50px;

 }

</style>

<table>

<tr>

<td class="padded">This cell is styled using the CSS padding-left property - kind of the CSS equivalent of cellpadding in HTML. Try changing the values to see the effect it has on the padding of the cell.</td></tr>

<tr><td>This cell is NOT styled using the CSS padding property.</td>

</tr></table>

</raw>

http://www.quackit.com/css/properties/css_padding-left.cfm

 

 

 

Comments (0)

You don't have permission to comment on this page.