Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table inside a table

Status
Not open for further replies.

pdbowling

Programmer
Mar 28, 2003
267
US
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,
Patrick

 
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.

Code:
table tr td
[COLOR=#FF0000]{[/color]
[tab][COLOR=#0000FF]padding:[/color][i][COLOR=#009900]0px[/color][/i];
[COLOR=#FF0000]}[/color]

table tr td table
[COLOR=#FF0000]{[/color]
[tab][COLOR=#0000FF]margin:[/color][i][COLOR=#009900]0px[/color][/i];
[COLOR=#FF0000]}[/color]

----------------------------------
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
 
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.
 
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.

mmerlinn


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top