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

 

 

 


Page Information

  • 11 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts