Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html cellpadding the left side of a cell

Tags:

html

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 .

like image 376
Night Walker Avatar asked Dec 30 '11 18:12

Night Walker


People also ask

How do you add padding-left in HTML?

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>

How do you space in a cell in 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.

How do you add padding to a table cell in CSS?

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.


1 Answers

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.

like image 69
Ben D Avatar answered Sep 18 '22 18:09

Ben D