Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

HTML nasty bug with tables....

Quote Reply
HTML nasty bug with tables....
I just ran into a situation trying to change the sort order in nph-build (see ....)
because my link.html is between <tr>...</TR> tags.
<P>
What I was getting on the screen was all the category names at the top, with
the links all at the bottom..
<P>
This was because the category name was inserted into the HTML after the TABLE tag, but
between <TR> tags. It _looked_ like the category names were all being processed first,
then the links. After a dozen edits and changes, I looked very, very closely at the
html..
<P>
This is a really good example of why you should really make all the inserted templates
and files adhere to the same format. Either a ROW or a complete TABLE.
<P>
This is the _most_ obscure bug I have ever tracked down, and it showed the _same_ in both
NN and MSIE (which is unusual). Usually one or the other will alert you to where the
potential problem is, so the first thing to do is look at your page in the other other
browser. If it looks the way you expected, it's an HTML/style thing.
<P>
In this case, both browsers handled the broken HTML the same way, even fomatting it the
same inside a containing table, and made it look like it was perl/cgi problem.
<P>
I got lucky looking for it --- in the HTML the "links" looked the way they should be,
not grouped into a top and bottom section, so I finally realized it had to be an HTML
thing.

<P>
Here is an excerpt of the HTML:

Code:

</TR>
<P><B>Cool Link #2 was found in : </B><BR> <A HREF="http://www.postcards.com/pcSQL/pages/Categorized_Sites/index.html">Categorized Sites</A></p>
<TR VALIGN=TOP ALIGN=RIGHT>
<TD ROWSPAN=2 WIDTH=122 VALIGN=MIDDLE ALIGN=RIGHT>

<P>
by doing this, I created the bizzare bug I've ever had to track. It's Miller time!!


===

If you are interested, the whole file is at:
http://postcards.com/...n_table_example.html It's pretty amazing how this formats ... not at all what you'd expect.

[This message has been edited by pugdog (edited November 28, 1999).]
Quote Reply
Re: HTML nasty bug with tables.... In reply to
Additionally, if you make the changes to nph-build to make it work, you need to remember that there are several (at least 3 other) places to change.

The What's New and Cool areas both use the same sort of logic, where the category name is inserted between links or groups of links.

If your link.html starts with a <tr> tag, then you probably will need to make changes to the embedded html to the two build subroutines.

You also need to add it to the search.cgi (I don't know about ni_search.cgi) where it outputs the linked category name.

Hopefully Alex will find a way to pull that out into something easier to edit. It might mean a change to the logic, and it's something to think about. Embedded html is a problem, as this shows.

Anything that outputs HTML to a template or file should be editable, to avoid problems like this.

This was a really obscure formatting bug, and now that I got it pretty well nailed, hopefully it will explain the bizzare behaviour that was bothering me for a long time!

I _think_ it's the <P> tags in the embedded HTML. By using <P> and </P> the text became a container, and the browsers handled it differently than expected -- they bubbled them to the top, rather than in-lining them as usually happens.

Anyway, this should help make the format changes to the New and Cool pages, and allow you some extra flexibility.





[This message has been edited by pugdog (edited November 29, 1999).]
Quote Reply
Re: HTML nasty bug with tables.... In reply to
Hello!

Following has nothing directly to do with your message but I just thought it may be interesting to put here! Smile Wink Smile

www.validator.w3.org/check?uri=www.gossamer-threads.com

The result says something about <P> tags also!
Quote Reply
Re: HTML nasty bug with tables.... In reply to
is this in search.cgi?

just fix it in search.cgi find a foreach that has to do with it..

i'm working on a 15 inch monitor and like 13.1 viewable cause my monitor blew up the other day.. (too much use i guess.. it was only 5 months old).. it only has 16 colors and i seriously don't want to open another window to look at search.cgi Smile

jerry
Quote Reply
Re: HTML nasty bug with tables.... In reply to
No, this a problem in template generation.... if you try to insert <P> tags or text between <TR> tags, the browsers do some very, very weird things.

It's just a matter of fixing the HTML so that you are not inserting bare text into the files inside a table. It's not a code problem... just a logic one.