wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Nested Tables and Colspan attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Nested Tables and Colspan attribute" Watch "Nested Tables and Colspan attribute" New topic
Author

Nested Tables and Colspan attribute

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I have a Table within a Table, and I am using a Colspan in one of the TDs inside the inner Table. I am also aligning it center, but it seems to be off.
So basically I have this structure

It appears that the colspan is working for the outside Table, and there for centers over the Menu and first column of the inner table. I want it to center over the two columns of the inner table.
Any suggestions.
Thanks
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
??

You type this wrong?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I color coded and played with it:
Is this what you wanted?

Eric
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Yes, I typed it wrong, the actual HTML has matching open and closing tags.
I guess the biggest part is the Colspan. How in the outer table there are two columns, in the inner table in the right column of the outer table, there are two columns. That is why I had colspan="2" for the inner table to center in the right column of the outer table, and not centered to the entire outer table over its two columns, which is what it appears to be doing.
Mark
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Yes, Eric that is what my code looks like, except for your better use of the attributes, than my old style. I must say that the look of my screen in terms of colors and general look is pretty ugly, but I will never never claim to be a web designer. I am just an application developer
Mark
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

And that is exactly what I was looking for. In terms of things being centered and location wise. Thanks.
Now I just have to figure out how to make it so I don't have to copy and paste the Table attributes to all my jsp pages and make it more templatized.
Thanks
Mark
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

OK, I got it templatized, but I don't get the same results as you do Eric. It is still off. I can't figure it out. The problem is that I am using Struts, and Tiles, so I have a layout.jsp which is very simple, then the menu and content are changed on the fly using Struts, so the content jsp files are the inner tables, and I work them as if I have the entire right side, and just worry about the inner table, but that doesn't work. I don't know if I should post all the jsp files here and have you try, or just accept an ugly web site.
Mark
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
look at the source of the generated HTML page. You might be able to see the problem.
Eric
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Unfortunately, when I select view source from IE I don't get anything to pop up.
Mark
 
Don't get me started about those stupid light bulbs.
 
subject: Nested Tables and Colspan attribute
 
Similar Threads
css question
when will a thread stop
Help me about html:select
problem in jsp !!!
Getting Values from a window to parent page