Forum Moderators: open

Message Too Old, No Replies

Cell Heights & Navigation List

making the old "table trick" work

         

rogerd

1:42 pm on Mar 18, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A while back, there was a discussion here about the difficulty of controlling cell heights. Specifically, the popular practice of inserting a short cell above a left-side navigation list to put it below the content in the HTML seemed to be problematic in many common browsers.

Most are probably familiar with the issue, but if not, the simplest configuration is a table with two columns - the right column occupies most of the page and contains the main page content. The left column is composed of two cells, a skinny one on top, and a larger one below containing site navigation links. The first table row contains the skinny cell in column 1 and the sole cell in column 2. The second table row contains the second cell in the first column.

The problems seem to arise when there is a lot of content on the page, i.e., column 2 gets quite long. When that happens, the "skinny" cell at the top of the first column seems to stretch out, even if a height has been specified in pixels. This is really the crux of the problem - browsers tend to ignore the cell height specification at times even when there is no internal element (text or image) to force it to a larger size.

I've experimented with various solutions, including specifying a large height value for the second cell containing the nav list - this works, but makes the page needlessly long for pages with short content. (Annoying to visitors who scroll down looking for more, or worse, print out the page and get a pile of blanks.)

I know there are other ways to skin this cat, like putting the nav menu on the right, but it seems like something that shouldn't be that difficult to fix. Last time this came up here, it seemed that the discussion trailed off without a definitive solution. Is it indeed unsolvable?

tedster

2:20 pm on Mar 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check out the second workaround on this page [web.archive.org].

Our previous Table Trick thread [webmasterworld.com].

And about those right hand menus---

Usability.gov [usability.gov] recommends right hand nav, based on usability research.

rogerd

2:59 pm on Mar 18, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yeah, I kind of like right-hand navigation too, but some clients find it weird. Unfortunately, right hand navigation is kind of like the Dvorak keyboard - faster and more ergonomic, but everyone is trained on QWERTY. (Not quite as hard to retrain for right-hand navigation, fortunately!)

The "second workaround" is straightforward, but it presumes you can control the table structure on each page. Using page templates or dynamic pages where the text content just gets poured into a cell would make this more complex - short content would stay in one cell, long content would have to be split between the two tables. :( Definitely a good way to go, though, if you have the flexibility to split the content. (Actually, I don't think a new table is even necessary - starting a new row in the same table would work equally well, I think.)

I'm going to play with the other fix possibilities. It's really an aggravating problem, since no fix is needed most of the time. When you get a super-long page, though, suddenly the browser forgets about specified cell heights. Thanks for the suggestions.

foggy11

4:19 pm on Mar 18, 2002 (gmt 0)

10+ Year Member



I have a related problem involving a simple 1 by 2 table with Netscape 6.2

Table works fine with IE5, Opera 5, and Omniweb, but Netscape 6 splits the table top and bottom instead of side to side!

The problem is on the site in my profile, on the page community.html in the bottom frame.

Could someone check this out and give me an answer?

Thanks for all the geat ideas and insight you all provide. This forum has been very valuable to me.

foggy

(edited by: tedster at 12:25 am (utc) on Mar. 19, 2002)

AlbinoRhyno

12:02 am on Mar 19, 2002 (gmt 0)

10+ Year Member



My feelings on right-hand navigation studies here:
[webmasterworld.com...]

tedster

12:36 am on Mar 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, foggy11

On your problem page, you have a div before the table that gets closed two times instead of once. Might be what confuses NN6.

foggy11

11:16 pm on Mar 29, 2002 (gmt 0)

10+ Year Member



Tedster'

Many thanks for the help. The double div tags wasn't the problem, but i appreciate your input and polite correction of my URL faux pas.

The problem was , believe it or not, no closing TD or TR tags !!!!!

These modern day browsers are more robust than we give them credit for when they can compensate for horrendous coding by culprits such as moi!

tedster

1:40 am on Mar 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shame on me for not catching those open table rows and cells. That's the first thing to look for - and it's easy enough to make the mistake if you do a lot of cut/copy/paste over time.

That's one of the reasons I use Homesite - I can do continual validation checks all the time I'm working on a page. It helps to catch my flubs early.

Rhys

11:47 am on Mar 31, 2002 (gmt 0)

10+ Year Member



Hi -
The method I use to solve this, and which seems to work well over different browsers, is to put an empty row of cells at the top and control the table width using a 1 x 1px GIF with appropriate width statements - like <img src="blank.gif" width=120 height=2 >.
To control cell height, put a <img src="blank.gif" align=left width=2 height=50 >(or whatever height you need), in each cell that needs a height statement. As long as you don't put anything wider than your width statements in each cell, it is an easy method of controlling size.

rogerd

2:47 pm on Apr 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Rhys, in your experience will this approach keep the cell from growing taller in IE and/or NN if the main page content is unusually long? I've found that even with a fixed-dimension image in the cell, the cell can stretch. Setting the height of other cells to large values reduces, but doesn't eliminate, the stretching.

Rhys

10:05 am on Apr 2, 2002 (gmt 0)

10+ Year Member



<will this approach keep the cell from growing taller in IE and/or NN>

No - Sorry, I think not.

My practise is to set up the table using initial blank rows and columns of 1px gif's set at the biggest likely size, and then position the cell content to look good. I find this more reliable than trying to set the cell sizes with attribute statements, and in bigger tables, it saves on code weight. It is easier than trying to exactly fill table cells with content plus gaps to keep the proportions looking even

rogerd

5:45 pm on Apr 2, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What's needed is a browser that obeys the cell height setting and makes changes only in the event of a direct conflict (e.g., two cells that are 10 pixels and 100 pixels high adjacent to a cell that's 200 pixels high - something's got to give, in that case). Current browsers seem to treat the cell height as a suggestion, even when there's no conflict that would necessitate a change. Maybe I'll call Bill & point this out.