I want to pad my text in a cells on the right side with additional space .
I don't use css style sheets .
this is my code <table border="1" CELLPADDING="5">
on right size for example I want 10.
Thanks .
If we want to apply only left padding to an element, then we have to use only padding-left property in the id selector. And, then we have to set only one value to the property as shown in the following example: <! Doctype Html>
Cell padding is the space between cell borders and the content within a cell. To set cell padding in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <table> tag, with the CSS property padding.
You can easily set padding inside the table cells using the CSS padding property. It is a valid way to produce the same effect as the table's cellpadding attribute. Similarly, you can use the CSS border-spacing property to apply the spacing between adjacent table cell borders like the cellspacing attribute.
This is what css is for... HTML doesn't allow for unequal padding. When you say that you don't want to use style sheets, does this mean you're OK with inline css?
<table> <tr> <td style="padding: 5px 10px 5px 5px;">Content</td> <td style="padding: 5px 10px 5px 5px;">Content</td> </tr> </table>
You could also use JS to do this if you're desperate not to use stylesheets for some reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With