Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Table inside a table

Table inside a table

Table inside a table

Hello everyone.

I have put many tables inside of other tables. I am just curious now if there is a way to set the attributes of the inner and outer tables so that the cell border of the outer table is the same set of lines as the table border of the inner table.

They always seem to come up with space between the cell and the table inside.

Thank you,

RE: Table inside a table

For starters, unless you are actually displaying tabular data, you should not be using tables like that.

In any case, all elements have a padding and margin set to them by default.

You may want to try removing the padding and margins of the tables and cells.


table tr td

table tr td table

Phil AKA Vacunita
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

RE: Table inside a table

You should indeed not use tables for layout purposes, but divs or the new HTML5 elements <section>, <header>, <footer>, <article>, <menu> and <aside).

Also, even with a margin and padding of 0, the borders will not be superimposed on each other. Only with absolute positioning, but then you are really going to make a messy layout of it.

I would suggest to start doing a basic HTML and CSS course, at for example W3 Schools. After a short while you'll be happy that you did, because using proper elements plus CSS gives much, much more possibilities than tables, for layout.

How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.

RE: Table inside a table

And when you do move away from tables for layout, be sure that you test pages thoroughly. You don't want pages that bleed off the right side of the screen with NO SCROLL BAR AT THE BOTTOM. It is irritating to find such poorly coded pages. And the only solution I have found (sometimes) is to reduce the font so small that it cannot be read.



Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close