What can be inside a div?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Falc2199

    What can be inside a div?

    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

    #2
    Re: What can be inside a div?

    "Falc2199" <JehanNYNJ@aol. com> wrote in message
    news:ee51372.04 06011405.790d59 96@posting.goog le.com...[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


    Comment

    • Ivo

      #3
      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


      Comment

      • Martin Sammtleben

        #4
        Re: What can be inside a div?

        In article <ee51372.040601 1405.790d5996@p osting.google.c om>,
        JehanNYNJ@aol.c om (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

        Comment

        • Andrew Thompson

          #5
          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.or g/>

          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

          Comment

          • jackie

            #6
            Re: What can be inside a div?

            even google can't pass it 100%

            Andrew Thompson <SeeMySites@www .invalid> wrote in message
            news:11db0bjb9t trc.13spkjpppxh ky$.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.or g/>
            >
            > 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]


            Comment

            • Dag Sunde

              #7
              Re: What can be inside a div?

              "jackie" <on@on.com> wrote in message
              news:c9ju3i$5vn 34@imsp212.netv igator.com...[color=blue]
              > Andrew Thompson <SeeMySites@www .invalid> wrote in message
              > news:11db0bjb9t trc.13spkjpppxh ky$.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.or g/>
              > >
              > > 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


              Comment

              • Andrew Thompson

                #8
                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.or g/>[/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

                Comment

                • Tim Slattery

                  #9
                  Re: What can be inside a div?

                  JehanNYNJ@aol.c om (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

                  Comment

                  • Richard Cornford

                    #10
                    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.


                    Comment

                    • Thomas 'PointedEars' Lahn

                      #11
                      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

                      Comment

                      • Richard Cornford

                        #12
                        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.


                        Comment

                        • Tim Slattery

                          #13
                          Re: What can be inside a div?

                          "Richard Cornford" <Richard@litote s.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

                          Comment

                          • Thomas 'PointedEars' Lahn

                            #14
                            Re: What can be inside a div?

                            Tim Slattery wrote:
                            [color=blue]
                            > "Richard Cornford" <Richard@litote s.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

                            Comment

                            • Thomas 'PointedEars' Lahn

                              #15
                              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

                              Comment

                              Working...