Connecting Tech Pros Worldwide Forums | Help | Site Map

What can be inside a div?

Falc2199
Guest
 
Posts: n/a
#1: Jul 23 '05
Is there any limitations as to what can be inside <div id = "" >
</div> ? Can you place TDs and TRs for table inside it?

Thanks,
Jehan
Dag Sunde
Guest
 
Posts: n/a
#2: Jul 23 '05

re: What can be inside a div?


"Falc2199" <JehanNYNJ@aol.com> wrote in message
news:ee51372.0406011405.790d5996@posting.google.co m...[color=blue]
> Is there any limitations as to what can be inside <div id = "" >
> </div> ? Can you place TDs and TRs for table inside it?
>[/color]

Why not try it?
The answer is only 1 minute in a text-editor away...

You can put any ordinary html-tag inside a <div> section.

--
Dag
58°26'15.9" N 008°46'45.5" E


Ivo
Guest
 
Posts: n/a
#3: Jul 23 '05

re: What can be inside a div?



"Dag Sunde" wrote[color=blue]
> "Falc2199" wrote[color=green]
> > Is there any limitations as to what can be inside <div id = "" >
> > </div> ? Can you place TDs and TRs for table inside it?
> >[/color]
>
> Why not try it?
> The answer is only 1 minute in a text-editor away...
>
> You can put any ordinary html-tag inside a <div> section.
>[/color]

Exactly. A good text-editor allows you to type
<div><html></html></div>
but there certain limitations as to what is valid in a properly marked up
document. TDs and TRs for example can only used inside a TABLE. The use of
DIV elements as explained at
<URL: http://www.w3.org/TR/REC-html40/stru...l.html#h-7.5.4 >
features an example of a table inside a div.
As far as javascript is concerned (this newsgroup's topic), strange markup
may cause strange behaviour.
Ivo


Martin Sammtleben
Guest
 
Posts: n/a
#4: Jul 23 '05

re: What can be inside a div?


In article <ee51372.0406011405.790d5996@posting.google.com> ,
JehanNYNJ@aol.com (Falc2199) wrote:
[color=blue]
> Is there any limitations as to what can be inside <div id = "" >
> </div> ? Can you place TDs and TRs for table inside it?[/color]

A <div> is nothing but a generic container that defaults to
display:block, forcing a line break before and after, as opposed to
<span> which defaults to display:inline.

You can however set a <div> to float or inline using css.

To answer your question, you can put just about any element inside a
<div>.

--
Cheers Martin
Andrew Thompson
Guest
 
Posts: n/a
#5: Jul 23 '05

re: What can be inside a div?


On 1 Jun 2004 15:05:53 -0700, Falc2199 wrote:
[color=blue]
> Is there any limitations as to what can be inside <div id = "" >
> </div> ? Can you place TDs and TRs for table inside it?[/color]

<http://validator.w3.org/>

If more web-desingers, Javascript and
Java programmers used it, the web would
be a better place for it.

[ ..and yes, the information given to you over
on c.i.w.a.s seems correct. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
jackie
Guest
 
Posts: n/a
#6: Jul 23 '05

re: What can be inside a div?


even google can't pass it 100%

Andrew Thompson <SeeMySites@www.invalid> wrote in message
news:11db0bjb9ttrc.13spkjpppxhky$.dlg@40tude.net.. .[color=blue]
> On 1 Jun 2004 15:05:53 -0700, Falc2199 wrote:
>[color=green]
> > Is there any limitations as to what can be inside <div id = "" >
> > </div> ? Can you place TDs and TRs for table inside it?[/color]
>
> <http://validator.w3.org/>
>
> If more web-desingers, Javascript and
> Java programmers used it, the web would
> be a better place for it.
>
> [ ..and yes, the information given to you over
> on c.i.w.a.s seems correct. ]
>
> --
> Andrew Thompson
> http://www.PhySci.org/ Open-source software suite
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.1point1C.org/ Science & Technology[/color]


Dag Sunde
Guest
 
Posts: n/a
#7: Jul 23 '05

re: What can be inside a div?


"jackie" <on@on.com> wrote in message
news:c9ju3i$5vn34@imsp212.netvigator.com...[color=blue]
> Andrew Thompson <SeeMySites@www.invalid> wrote in message
> news:11db0bjb9ttrc.13spkjpppxhky$.dlg@40tude.net.. .[color=green]
> > On 1 Jun 2004 15:05:53 -0700, Falc2199 wrote:
> >[color=darkred]
> > > Is there any limitations as to what can be inside <div id = "" >
> > > </div> ? Can you place TDs and TRs for table inside it?[/color]
> >
> > <http://validator.w3.org/>
> >
> > If more web-desingers, Javascript and
> > Java programmers used it, the web would
> > be a better place for it.[/color]
>
> even google can't pass it 100%
>[/color]

That's no reason why you sholdn't strive for it!

--
Dag
58°26'15.9" N 008°46'45.5" E


Andrew Thompson
Guest
 
Posts: n/a
#8: Jul 23 '05

re: What can be inside a div?


On Wed, 02 Jun 2004 07:30:27 GMT, Dag Sunde wrote:[color=blue]
> "jackie" <on@on.com> wrote in message[color=green]
>> Andrew Thompson <SeeMySites@www.invalid> wrote in message[color=darkred]
>>> On 1 Jun 2004 15:05:53 -0700, Falc2199 wrote:
>>>
>>> > Is there any limitations as to what can be inside <div id = "" >
>>> > </div> ? Can you place TDs and TRs for table inside it?
>>>
>>> <http://validator.w3.org/>[/color][/color][/color]
...[color=blue][color=green]
>> even google can't pass it 100%[/color][/color]
...[color=blue]
> That's no reason why you sholdn't strive for it![/color]

Absolutely. I do not doubt that some of my
own pages would show errors through the validator
(I am better at *generating* pages than remembering
to *validate* them!), but if I was having a problem
with page layout, it is the *first* thing to
check (/and) fix.

Of course.. Then comes the matter of (selectively)
hiding *styles* from the less capable browsers that
can actually lock-up/freeze at entirely valid CSS..

...an area I have yet to investigate properly.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Tim Slattery
Guest
 
Posts: n/a
#9: Jul 23 '05

re: What can be inside a div?


JehanNYNJ@aol.com (Falc2199) wrote:
[color=blue]
>Is there any limitations as to what can be inside <div id = "" >
></div> ? Can you place TDs and TRs for table inside it?[/color]

You can put an entire table inside of a DIV, but you can't put only
part of a table into a DIV. Unfortunate, if you could do that you
could make a table where the headers are always visible but the
content scrolls under them. (I know, you can simulate that with two
tables.)

--
Tim Slattery
Slattery_T@bls.gov
Richard Cornford
Guest
 
Posts: n/a
#10: Jul 23 '05

re: What can be inside a div?


Tim Slattery wrote:
<snip[color=blue]
> You can put an entire table inside of a DIV, but you
> can't put only part of a table into a DIV. Unfortunate,
> if you could do that you could make a table where the
> headers are always visible but the content scrolls under
> them. (I know, you can simulate that with two tables.)[/color]

As the contents of tables are already partitioned into THEAD, TFOOT
(both optional) and one or more TBODY (by implication if not explicitly
provided in the HTML) there would be no need to place a DIV into a table
to separately group its contents. To scroll a table body while the
headers stay still should only require that the TBODY have a scrolling
overflow CSS property while the THEAD did not. Reality doesn't deliver
on that either but there is still no advantage for DIVs to be allowed in
that context.

Richard.


Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#11: Jul 23 '05

re: What can be inside a div?


Richard Cornford wrote:
[color=blue]
> As the contents of tables are already partitioned into THEAD, TFOOT
> (both optional) and one or more TBODY (by implication if not explicitly
> provided in the HTML) there would be no need to place a DIV into a table
> to separately group its contents. To scroll a table body while the
> headers stay still should only require that the TBODY have a scrolling
> overflow CSS property while the THEAD did not. Reality doesn't deliver
> on that either [...][/color]

It does in Gecko-based browsers, however cross-browser support is
limited and maybe the feature implementation in Gecko is buggy.
Maybe <http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/> is
a bad example (only a quickhack, seems the body is too wide), but
it is still an example that it can be done.


PointedEars
Richard Cornford
Guest
 
Posts: n/a
#12: Jul 23 '05

re: What can be inside a div?


Thomas 'PointedEars' Lahn wrote:[color=blue]
> Richard Cornford wrote:[/color]
<snip>[color=blue][color=green]
>> ... . To scroll a table body while the headers stay still
>> should only require that the TBODY have a scrolling overflow
>> CSS property while the THEAD did not. Reality doesn't deliver
>> on that either [...][/color]
>
> It does in Gecko-based browsers, however cross-browser support is
> limited and maybe the feature implementation in Gecko is buggy.
> Maybe <http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/> is
> a bad example (only a quickhack, seems the body is too wide), but
> it is still an example that it can be done.[/color]

Yes it can be done, and I am optimistic that in future it will be widely
supported and commonly done, as there certainly seems to be demand for
the facility. But in our current climate if it cannot be done in IE you
won't be able to sell the idea in any commercial context.

On the other hand, maybe a comparison of clientHeight and scrollHeigth
(or similar dimensions) could tell you when TBODY was not honouring
scrolling overflow and allow a bit of DOM manipulation to have the TBODY
pulled from the original table and inserted into a second within a
specially created scrolling DIV, as a fallback for IE. Unfortunately
that would be javascript dependent while the CSS approach is not.

Richard.


Tim Slattery
Guest
 
Posts: n/a
#13: Jul 23 '05

re: What can be inside a div?


"Richard Cornford" <Richard@litotes.demon.co.uk> wrote:
[color=blue][color=green]
>> Maybe <http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/> is[/color][/color]

Looks to me like that page is implemented by putting the table header
and body in different frames. Not really an example of what we're
talking about.

--
Tim Slattery
Slattery_T@bls.gov
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#14: Jul 23 '05

re: What can be inside a div?


Tim Slattery wrote:
[color=blue]
> "Richard Cornford" <Richard@litotes.demon.co.uk> wrote:[color=green][color=darkred]
>>> Maybe <http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/> is[/color][/color]
>
> Looks to me like that page is implemented by putting the table header
> and body in different frames.[/color]

Look into it again with a *Gecko-based* browser. Only the index
buttons are in another frame, not the table headers. Here is the
URL of the content frame (containing the entire table):

<http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/idx-cont.htm>
[color=blue]
> --[/color]

Not really a valid signature delimiter. Should be dashDashSpace.


F'up2 poster

PointedEars
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#15: Jul 23 '05

re: What can be inside a div?


Richard Cornford wrote:
[color=blue]
> Thomas 'PointedEars' Lahn wrote:[color=green]
>> Richard Cornford wrote:[/color]
> <snip>[color=green][color=darkred]
>>> ... . To scroll a table body while the headers stay still should only
>>> require that the TBODY have a scrolling overflow CSS property while
>>> the THEAD did not. Reality doesn't deliver on that either [...][/color]
>>
>> It does in Gecko-based browsers, however cross-browser support is
>> limited and maybe the feature implementation in Gecko is buggy. Maybe
>> <http://www.stud.tu-ilmenau.de/~thla-in/ufpdb/transprt/> is a bad
>> example (only a quickhack, seems the body is too wide), but it is still
>> an example that it can be done.[/color]
>
> Yes it can be done, and I am optimistic that in future it will be widely
> supported and commonly done, as there certainly seems to be demand for
> the facility.[/color]

If nobody (or not enough people) push(es) the issue by using the feature,
it will never be widely implemented with the lame excuse that there is
no(t enough) demand for it.
[color=blue]
> But in our current climate if it cannot be done in IE you
> won't be able to sell the idea in any commercial context.[/color]

1. Why would I want to sell it? I assume people are smart anough to see
where are the advantages and disadvantages for themselves. Don't you
think that if one visits the site with different browsers and see that
Gecko-based ones (or basically all that implement the discussed feature)
have an advantage here will recognize it?

2. Disagreed. Taking the other, much more serious bugs and security flaws
of IE into account, I am confident that one can be convinced to support
more standards-compliant and secure browsers and provide for graceful
degradation for the rest, which IMHO a table where the headers also
scroll certainly is.


PointedEars
Richard Cornford
Guest
 
Posts: n/a
#16: Jul 23 '05

re: What can be inside a div?


Thomas 'PointedEars' Lahn wrote:[color=blue]
> Richard Cornford wrote:[color=green]
>> Thomas 'PointedEars' Lahn wrote:[/color][/color]
<snip>[color=blue]
> If nobody (or not enough people) push(es) the issue by using the
> feature, it will never be widely implemented with the lame excuse
> that there is no(t enough) demand for it.[/color]

I am not sure this one needs promoting, just implementing. It is
actually mentioned as a possibility in the HTML specs (in the section on
THEAD, TBODY, TFOOT) and implied (at least not excluded) by the CSS
specs.
[color=blue][color=green]
>> But in our current climate if it cannot be done in IE you
>> won't be able to sell the idea in any commercial context.[/color]
>
> 1. Why would I want to sell it? I assume people are smart anough to
> see where are the advantages and disadvantages for themselves.
> Don't you think that if one visits the site with different
> browsers and see that Gecko-based ones (or basically all that
> implement the discussed feature) have an advantage here will
> recognize it?[/color]

I don't mean sell it in the sense of promote it. I mean, given a client
who wants a table body to scroll and the headers to (at least
apparently) stay still, presenting them with code that works fine in
Gecko browsers (and any number of others) but not IE is not going to
work. If they don't see it working in IE then as far as they are
concerned you haven't delivered.

Whatever you or I may think of that, it is a hard commercial reality.
[color=blue]
> 2. Disagreed. Taking the other, much more serious bugs and security
> flaws of IE into account, I am confident that one can be convinced
> to support more standards-compliant and secure browsers and
> provide for graceful degradation for the rest, which IMHO a table
> where the headers also scroll certainly is.[/color]

The marketing managers who think flashy presentation sells things, but
know nothing about the technicalities (why should they?), look at the
browser statistics (which they also don't understand) and decide that
the apparently most popular browsers are an environment in which it is
vital to be able to make that flashy presentation. You can explain that
the statistics are horribly inaccurate and biased and that using
standard promotes interoperability etc, but if you don't give them what
they want in javascript enabled IE 6 then you haven't delivered.

For that to change it is the users that need to be convinced to be using
other browsers. Security flaws in IE, Microsoft's reluctance to update
it and ever better alternative browsers seem to be producing some change
in that direction, but not yet enough to stop (active) IE 6 support from
being the absolute minimum requirement for any commercial project.

Richard.


Closed Thread


Similar JavaScript / Ajax / DHTML bytes