Link to home
Start Free TrialLog in
Avatar of ruthie2012
ruthie2012

asked on

CSS padding around table that is inside box

Is there any way of adding padding around a table and with the table inside a box (with a border) using CSS. I have tried lots of diferent ways and I'm stuck. I'm trying to create the look of the old html table inside a table so that I can get a thin border, but have white space between the inside table and the ouside border. Thanks
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

If you are using a DIV to enclose the table, that will be your problem, if just tables, there is no problem.
Avatar of ruthie2012
ruthie2012

ASKER

Thanks for your response.
Can I enclose the outside box in a div?
On my page I have a maincontainer div that is 600px wide. All I want to do is have say 3 or 4 equal sized and spaced boxes across and 2 or 3 rows down. I'm trying to do it without tables but I would like to include a table in some of the boxes. I can't attach any code because it's rubbish - not working at all. Please could you point me in the right direction. Thanks.
The DIV around a table will give you problems, no matter what you do.  To fix the DIV at 600, you have to then calculate the table at 600- all the padding in the table, and it is a NEEDLESS pain in the neck.  

"I mean doesn't the browser automaticly figure that the page should be viewed in the whole window if possible? "

If you want tables, then USE them and get rid of the DIV around them.  If you insist on putting a DIV around a table, your HTML will not work until you figure out how different they are.

If you want a table with equal sized table cells, leave it as a table -- the DIV will FOUL it up !!!
ASKER CERTIFIED SOLUTION
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks scrathcyboy. I'll stick with the table!!