<DIV> inside a <DIV>

1 view
Skip to first unread message

Kevin Owens

unread,
Jul 2, 1998, 3:00:00 AM7/2/98
to

I have a <DIV> inside another <DIV>. I want to hide some rows in a table,
so these rows are inside a <DIV> and I'm changing the DISPLAY property to
'none'. However, it doesn't hide the rows. Basically, here's what I'm
doing:

Sub hideit()
Row1.style.display="none"
End Sub

......

<DIV id="Table">
<TABLE>
<TR><TD>Header</TD></TR>
<DIV id="Row1" class="Row1">
<TR><TD>Row 1, Column 1</TD></TR>
</DIV>
</TABLE>
</DIV>

Anita Rowland (MS contractor)

unread,
Jul 2, 1998, 3:00:00 AM7/2/98
to

[Posted and emailed]

Hi, Kevin!

Dynamic HTML (HTML + script + CSS) which is what you are talking
about here, may not be strictly on topic in this newsgroup (c.i.w.a.h).

Thanks for including the code snippet so we can see what
you are doing!

Valid content inside TABLE:

<!ELEMENT tr - O (th|td)*>
from HTML 3.2 spec

<!ELEMENT TABLE - - (CAPTION?, (COL*|COLGROUP*),
THEAD?, TFOOT?, TBODY+)>
from HTML 4 spec

so you see that DIV isn't valid; it needs to be contained in an
element that is valid inside a table.

To work with rows in a TABLE in IE4, you need to use the
TABLE object Model

here's an article from SITEBUILDER on microsoft.com that may help
http://www.microsoft.com/workshop/author/dhtml/dude/dude040698.asp

Anita Rowland mailto:a-an...@microsoft.com
IE Program Management Team

Kevin Owens <ho...@mindspring.com> wrote in message
6ng5un$ito$1...@camel15.mindspring.com...

Kevin Owens

unread,
Jul 2, 1998, 3:00:00 AM7/2/98
to

I changed the inside <DIV> to a <SPAN>. Works fine.

Kevin Owens wrote in message <6ng5un$ito$1...@camel15.mindspring.com>...

Stanley Friesen

unread,
Jul 3, 1998, 3:00:00 AM7/3/98
to

On Thu, 2 Jul 1998 10:57:38 -0700, "Anita Rowland (MS
contractor)" <a-an...@microsoft.com.nospam> wrote:
>Valid content inside TABLE:
>
> <!ELEMENT tr - O (th|td)*>
> from HTML 3.2 spec
>
> <!ELEMENT TABLE - - (CAPTION?, (COL*|COLGROUP*),
> THEAD?, TFOOT?, TBODY+)>
> from HTML 4 spec
>
>so you see that DIV isn't valid; it needs to be contained in an
>element that is valid inside a table.
>
>Kevin Owens <ho...@mindspring.com> wrote in message
>6ng5un$ito$1...@camel15.mindspring.com...
>><DIV id="Table">
>><TABLE>
>><TR><TD>Header</TD></TR>
>><DIV id="Row1" class="Row1">
>><TR><TD>Row 1, Column 1</TD></TR>
>></DIV>
>></TABLE>
>></DIV>
>>
Hmm, looks like what Kevin wants is the TBODY element from HTML
4.0. That is the only way I know of to enclose row groups in
larger constructs.

<TABLE>
<THEAD>
<TR><TH>Header>/TH></TR>
</THEAD>
<TBODY>
<TR> ....</TR>
</TBODY>
</TABLE>


Greg Berigan

unread,
Jul 4, 1998, 3:00:00 AM7/4/98
to

ho...@mindspring.com (Kevin Owens) wrote:

> I changed the inside <DIV> to a <SPAN>. Works fine.

Maybe for now, but it is still invalid markup. SPAN is just as illegal
as DIV there. You may find a newer version will fail on it.

--
,=<#)-=# <http://incolor.inetnebr.com/wotw/> (The War of the Worlds)
,_--//--_,
_-~_-(####)-_~-_ Please pardon any typos. Bandwidth is at a premium lately
(#>_--'~--~`--_<#) and responsiveness is too sluggish to support post-editing.

Reply all
Reply to author
Forward
0 new messages