Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > padding inside table

Reply
Thread Tools

padding inside table

 
 
Paul Furman
Guest
Posts: n/a
 
      02-12-2004
How come this doesn't work for me? I tried all sorts of combinations and
the text inside the td's is smashed pretty tight to the edges by a
couple pixels or so. IE & Mozilla see nothing. Mozilla doesn't see the
background color but that's another issue. I want a little space between
the border and the text, that's padding, right?

Wrapping the contents in a div inside the td works
<div style="padding: 4px;">

this doesn't:
table.normal {
font-size: 8pt;
font-family: Arial;
background-color=#CCD8CD;
border=1px solid #aaaaaa;
border-collapse: collapse;
padding-left: 4px;
}
td.normal {
border=1px solid #aaaaaa;
padding: 4px;
}

<table class="normal" width="480px">
<tr>
<td align="left" class="normal">
text here

 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      02-12-2004
Paul Furman wrote:

> table.normal {
> font-size: 8pt;
> font-family: Arial;
> background-color=#CCD8CD;
> border=1px solid #aaaaaa;
> border-collapse: collapse;
> padding-left: 4px;
> }
> td.normal {
> border=1px solid #aaaaaa;
> padding: 4px;
> }


Get rid of the equals signs (=) and use colons ( instead.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
 
 
 
GD
Guest
Posts: n/a
 
      02-12-2004
Paul Furman <(E-Mail Removed)> wrote:
> How come this doesn't work for me?
> table.normal {
> background-color=#CCD8CD;
> border=1px solid #aaaaaa;
> padding-left: 4px;
> }
> td.normal {
> border=1px solid #aaaaaa;
> }


Padding is for the cells, not the table itself, but the main problem
here is the typos. You've used equals signs in 3 of the properties.

The CSS validator would have spotted these
http://jigsaw.w3.org/css-validator/

 
Reply With Quote
 
Paul Furman
Guest
Posts: n/a
 
      02-12-2004
GD wrote:
>
> Padding is for the cells, not the table itself,



OK so it only applies to <td>.


> but the main problem here is the typos.
> You've used equals signs in 3 of the properties.



Thanks I fixed that. And I've finally dumped it into a separate css file
so I won't have to run in circles to update leftover junk like that again.

The padding still doesn't work though.

 
Reply With Quote
 
GD
Guest
Posts: n/a
 
      02-12-2004
Paul Furman <(E-Mail Removed)> wrote:
> GD wrote:
> > Padding is for the cells, not the table itself,


> OK so it only applies to <td>.


And <th>

> The padding still doesn't work though.


Do you have an example URL? If you fixed the typo above the padding
property, I can't see anything else to stop it working.

 
Reply With Quote
 
Paul Furman
Guest
Posts: n/a
 
      02-12-2004
GD wrote:
> Paul Furman <(E-Mail Removed)> wrote:
>
>>The padding still doesn't work though.

>
>
> Do you have an example URL? If you fixed the typo above the padding
> property, I can't see anything else to stop it working.


OK, I uploaded this version with the div patch commented out:

http://hills.ccsf.edu/~pfurma02/inde...EEN=ecards.php
http://hills.ccsf.edu/~pfurma02/paul.css

and the relevant code:

<table class="normal" width="480px">
<tr>
<td align="left" class="normal">
<!-- <div style="padding: 4px;"> -->

Echivaria Topsy-turvey.<br>
<hr width=100%>
A selection of my favorite pictures taken in many locations
and sorted in no particular order. <!-- </div> -->
</td>
</tr>
</table>

 
Reply With Quote
 
Paul Furman
Guest
Posts: n/a
 
      02-12-2004
Paul Furman wrote:

> GD wrote:
>
>> Paul Furman <(E-Mail Removed)> wrote:
>>
>>> The padding still doesn't work though.

>>
>>
>>
>> Do you have an example URL? If you fixed the typo above the padding
>> property, I can't see anything else to stop it working.

>
>
> OK, I uploaded this version with the div patch commented out:
>
> http://hills.ccsf.edu/~pfurma02/inde...EEN=ecards.php
> http://hills.ccsf.edu/~pfurma02/paul.css



Oddly, it's maybe 2 pixels on the unix server at school and nearly
touching the border on my win2k apache server at home.

BTW, I've changed 'normal' to 'textbox'

Damn, now that overwrote whatever it was & they are both bad.


This is what was up a few minutes ago:

table.normal {
font-family: Arial;
background-color: #CCD8CD;
border: 1px solid #aaaaaa;
border-collapse: collapse;
}
td.normal {
border: 1px solid #aaaaaa;
padding: 4px;
}



>
> and the relevant code:
>
> <table class="normal" width="480px">
> <tr>
> <td align="left" class="normal">
> <!-- <div style="padding: 4px;"> -->
>
> Echivaria Topsy-turvey.<br>
> <hr width=100%>
> A selection of my favorite pictures taken in many locations
> and sorted in no particular order. <!-- </div> -->
> </td>
> </tr>
> </table>
>


 
Reply With Quote
 
Paul Furman
Guest
Posts: n/a
 
      02-12-2004
Paul Furman wrote:
>
> BTW, I've changed 'normal' to 'textbox'
>
> Damn, now that overwrote whatever it was & they are both bad.


OK that was it, I had the names mixed up. Too many times back & forth.

Sorry.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
table td padding Eustace HTML 34 10-07-2009 06:47 AM
Changing the inside Padding of a WebPart Alain Hogue ASP .Net 0 01-15-2006 05:20 AM
padding inside an input (text) tag =?ISO-8859-1?Q?=BBQ=AB?= HTML 8 01-12-2006 07:55 AM
How to align table with some left padding? RA ASP .Net 1 02-19-2004 06:25 PM
<tr> with a 1x1 image as a filler on a table with padding of 2 look thicker in netscape but they look ok in IE. Serial # 19781010 HTML 1 08-10-2003 09:05 PM



Advertisments