3 replies [Last post]
Auror
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2008-05-21
Posts: 2
Points: 0

I think the code says it all:





LibriPro.pl











I put a div inside a table. Don't ask why Smile I just need that.
I need to stretch the div to cover the whole space inside the cell it's located in.
The cell (or the whole table like in the code above) has like 300px x 200px, the div inside has the same dimentions. And there it is. An 1px outline. I can give the div 100% width and height. Still no luck.

Why is that?

I've tried setting all kinds of spacings, paddings and border to zero/none etc. Nothing works.

Is there a solution to this?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 38 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

td { padding: 0 }

td { padding: 0 }

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Auror
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2008-05-21
Posts: 2
Points: 0

you're a savier man! :)

Thanks a lot.

Still one question though.

This is not a "class" nor is it an "id". I cannot assign a "td padding: 0" to only one cell or only one table on my website, right?
This parameter will make a "0" padding for all the tables on the page?

I see that adding plain style="padding: 0;" to either the cell or the whole table doesn't work.

Why does it work only as "global" parameter?

Thanks a bilion for this!

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 38 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Auror wrote:I see that

Auror wrote:
I see that adding plain style="padding: 0;" to either the cell or the whole table doesn't work.

Works for me when I apply it to the <td>.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference