Help - Search - Members - Calendar
Full Version: Colspan when a table contains another table
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Illinois
I have an html coding question regarding COLSPAN. Itís probably a simple question, but I think itís an important one.

I have a webpage contained in a table. It has a row with one cell from left to right with a header image. This has a colspan 3.

Then I have a row with one cell containing five images from left to right (theyíre website buttons). This cell has a colspan 3.

- - - my problem - - sometimes the page displays with a one-pixel white gap between those foregoing two rows - - -

1. Then I have a row TR and a cell TD containing an image that tiles vertically on the left side, and ends with a /TD.

2. Then I have a cell TD that contains a table with 2 columns (this is the main website content area) and ends with a /TD.

3. Then I have a cell TD containing an image that tiles vertically on the right side, ends with a /TD, and ends the row /TR.

To finish, I have a row with one cell containing a footer image from left to right. The cell has a colspan 3.

Is is possible that my colspans should be 4, instead of 3? I used three because I thought the inside table would appear as one cell to the larger table.

But maybe the larger table recognizes that there are technically four columns - - when you add up the left and right columns for vertical tiles, and the two columns contained inside the inside table?

Thank you for your advice. I have also tried my webpage with 4 columns, and it has not displayed incorrectly yet - - but when my colspan=3 displays incorrectly, it only happens occasionally, so I canít be sure either way.

Or perhaps there is some other type of problem that I havenít thought of.
Thank you very much for your help.

I guess I should also mention that when I have my left-side vertical cell for an image tile, then my table (with two columns) nested inside a cell, and then my right-side vertical cell for an image tile - - well, I have 4 rows within the right-most column of that nested table.

I have no rowspans corresponding to that. I wonder if that may be a problem.

Thank you for reading my post. Any advice would be appreciated.
Darin McGrew
Can you provide the URL (address) of a document that demonstrates the problem?
pandy
QUOTE(Illinois @ Feb 19 2011, 04:49 AM) *

But maybe the larger table recognizes that there are technically four columns - - when you add up the left and right columns for vertical tiles, and the two columns contained inside the inside table?


No. That's not it. What Darin said...
Illinois
Thank you, Darin and pandy.
Yes, I will post this online. I should have done that before.
I will be back as soon as I get the URL added by the hosting company.
Thank you!
Frank
Illinois
Here is the URL of the page (I have only one page posted).

http://www.perryfreeman.com/

The trouble I have is that every fourth or fifth time that I bring up the page - -

there is a one or two pixel white gap between the header and the row of buttons.

I have been over the coding several times; I even drew a map of the coding for myself - - and it seems okay!

Although I donít know anything about the coding in the head - - I got that from another site, because it seems to keep the page up against the browser correctly - -

<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style type="text/css"><!--body { margin: 0; padding: 0 }
--></style>
</HEAD>

Thank you very much for taking a look at my coding,
Frank
Darin McGrew
I tried refreshing the page a number of times in all the browsers I have available (Firefox, Chrome, Safari, Opera, all on Mac), and didn't notice an extra gap once.

But your document lacks a doctype declaration, which puts browsers in quirks mode:
http://hsivonen.iki.fi/doctype/

And our online validator reports markup errors:
http://htmlhelp.com/cgi-bin/validate.cgi?u...mp;warnings=yes

Although I don't see any structural errors that would cause the problem you're describing.
pandy
Don't see a gap in IE6 either. What browser do you see it in?
Illinois
Thank you for the replies.
Iím looking at this in IE8.
Frank
pandy
Afraid none of us have IE8. You could add a doctype that takes browsers out of Quirks Mode and see if that helps though.

http://hsivonen.iki.fi/doctype/
Illinois
Yes, I will try some of the other doctypes. I tried that in the past, but I was puzzled by the way that the validator errors and warnings would change.
I would have about three errors with <html> and then using a different doctype such as strict or transitional, I would receive several different errors.
Seemed pretty daunting, like learning a new language!
But yes, I will pursue the other doctypes further.
Many thanks, Pandy and Darin. The forum is a good resource - - this is the first time I used it - - I should have been using it all along.
Frank
pandy
That's because the different flavours of (X)HTML have different rules. In Transitional you can use the old presentational stuff, like FONT, align and so on. In Strict you can't. XHTML is all lower case, in HTML case doesn't matter.

Talking about old stuff, you shouldn't use old proprietary markup like LEFTMARGIN and TOPMARGIN. Apart from being old and non-standard, it's IE only. Today we use CSS.

Add this to your style sheet instead.
CODE

body   { margin: 0; padding: 0 }

Illinois
Thank you very much Pandy - - what good advice, what good information.
I think on my next project I will begin with a CSS stylesheet.
I read the post ďSeeking sample of simple, correctly designed website,Ē and looked at links from Darin to, among others, Max Design - - http://www.maxdesign.com.au/articles/css-layouts/ and I should be able to make the switch to CSS.
This is a great forum, thank you very much.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.