Solved

CSS padding around table that is inside box

Posted on 2008-10-27
5
598 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:ruthie2012
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22819238
If you are using a DIV to enclose the table, that will be your problem, if just tables, there is no problem.
0
 

Author Comment

by:ruthie2012
ID: 22829147
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.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22837312
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 !!!
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 100 total points
ID: 22837320
the quote about was meant to be from your post -- an EE problem --
"I'm trying to do it without tables but I would like to include a table in some of the boxes."
0
 

Author Comment

by:ruthie2012
ID: 22839082
Thanks scrathcyboy. I'll stick with the table!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question