You are here: Re: Advice re. anchor within a table and handling var. browsers « HTML « IT news, forums, messages
Re: Advice re. anchor within a table and handling var. browsers

Posted by Ben C on 04/20/07 13:00

On 2007-04-20, jrf1@ntlworld.com <jrf1@ntlworld.com> wrote:
> Hi,
>
> I am developing an app. and I want to allow people to answer questions
> and jump the list of questions up as they do it. I can make this work
> but IE6 requires slightly different HTML than Firefox and Opera.
> See below...
>
> ** IE6 example *****
><table id="qtab">
><tr><a name='Q1'></a><td colspan=4> </td></tr>"
><tr>
><td class="q">Considers opportunities for growth and change.</td>
><td class="a"><input .............></td>
><td class="a"><input .............></td>
><td class="a"><input .............></td>
></tr>
> * tr repeated
></table>
>
[...]
> As you can see Firefox and Opera require the anchor Q1 to be within a
> TD. IE won't work with that setup and needs the anchor not to be
> defined
> within a table element.

It's invalid in a particularly nasty way to put an <a> and a " character
in a <tr> like that. If whatever bodge IE is doing with it works for you
today then that's lucky but this is not a sensible way to do things.

> The following script deals with this situation
>
><table id="qtab">
><script language="JavaScript">
> if (navigator.appName=="Microsoft Internet Explorer")
> { document.write("<a name='Q1'></a><td colspan=8> </td></tr>") }
> else
> { document.write("<td><a name='Q1'></a></td><td colspan=7>
></td></tr>") }
></script>
><tr>
><td class="q">Considers opportunities for growth and change.</td>
><td class="a"><input .............></td>
><td class="a"><input .............></td>
><td class="a"><input .............></td>
></tr>
> * tr repeated
></table>
>
> but it doesn't seem very elegant.

You have a gift for understatement.

> I'm not very happy with bits of script all through the page like this
> (as the page has a large number of questions on it). Can anyone
> suggest a better way?

No, but then I don't know exactly what you're trying to do. There has to
be a better way.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация