Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested Tables and Colspan attribute

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
??

You type this wrong?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I color coded and played with it:
Is this what you wanted?

Eric
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at the source of the generated HTML page. You might be able to see the problem.
Eric
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, when I select view source from IE I don't get anything to pop up.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic