[Javascript] Fw: innerHTML misplacing text

James Thomas jamestthomas at hotmail.com
Mon Aug 27 16:53:57 CDT 2007


Yes, misplaced table tags can cause havoc in screen display.  You might want 
to check the validity of your html with one of the many tools available.
----- Original Message ----- 
From: "Noah Sussman" <noah at onemorebug.com>
To: "JavaScript List" <javascript at lists.evolt.org>
Sent: Monday, August 27, 2007 5:48 PM
Subject: Re: [Javascript] innerHTML misplacing text


> On 8/27/07, lists at jdpill.com <lists at jdpill.com> wrote:
>> I have an oddity (possibly due to my lack of familiarity with 
>> javascript)...
>>
>> I'm trying to drop some html into a DIV, and while the text *is* being
>> placed in the html file, it is being put in the wrong place.
>
> As written, your code places a table cell inside a div.  If you view
> the rendered source of your page (using Firebug or IE Web Developer
> Toolbar, for instance) you will likely see that you have this:
>
>   <tr>
>     <div id="existingSiteOption"><td>Hello World!</td></div>
>   </tr>
>
> Which isn't valid HTML (because you have a DIV inside a TR but not
> inside a TD, and nested inside that is a TD whose parent is not a TR.
>
> Fixing that may fix your layout problem.
>
>
> -- 
> Noah Sussman
> Noah_|___OneMoreBug.com
>
> "the lyfe so short, the craft so long to lerne"  --Chaucer
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript
> 




More information about the Javascript mailing list