[Javascript] (no subject)

lists at jdpill.com lists at jdpill.com
Mon Aug 27 17:26:29 CDT 2007


James Thomas wrote:
> 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
>>

thanks guys, good point.

That being the case, if I want to insert two rows into the table, using
javascript, how could I do that within the bounds of valid HTML? One of
two code options is inserted by the js - one option having one row, the
second having two...? by inserting two rows (which will have rows before
and after), I'm going to have to have the div overlapping the cells and
rows at some point?





More information about the Javascript mailing list