Variable length scrolling <div> or <iframe>?

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

    Variable length scrolling <div> or <iframe>?

    I have had great success with using <iframe> with overflow-y set to auto. I
    can get a similar look with the <iframe> tag.

    BUT... In all cases I need to have fixed heights. Is there a way to put
    either tag inside an HTML <TD> and have the same kind of scrolling effect.

    This would allow me to fill the screen and have the size of the scrolling
    box change on resize.

    Thanks in advance.

    Jim


  • Chris Barber

    #2
    Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

    <table height="100%" width="100%" cellspacing="0" cellpadding="0" >
    <tr>
    <td>
    <div style="width: 100%; height: 100%; overflow: auto; border:
    1px solid red">
    A div with text in it that will stat at 100% of the holding block element
    size and also allow scrolling for off screen content.
    A div with text in it that will stat at 100% of the holding block element
    size and also allow scrolling for off screen content.
    A div with text in it that will stat at 100% of the holding block element
    size and also allow scrolling for off screen content.
    A div with text in it that will stat at 100% of the holding block element
    size and also allow scrolling for off screen content. </div>
    </td>
    </tr>
    </table>

    Border added for effect.

    Chris.

    "Jim M" <anonymouse@dis cussions.micros oft.com> wrote in message
    news:OHleONK5DH A.2572@TK2MSFTN GP09.phx.gbl...
    I have had great success with using <iframe> with overflow-y set to auto. I
    can get a similar look with the <iframe> tag.

    BUT... In all cases I need to have fixed heights. Is there a way to put
    either tag inside an HTML <TD> and have the same kind of scrolling effect.

    This would allow me to fill the screen and have the size of the scrolling
    box change on resize.

    Thanks in advance.

    Jim



    Comment

    • Armin Zingler

      #3
      Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

      "Jim M" <anonymouse@dis cussions.micros oft.com> schrieb[color=blue]
      > I have had great success with using <iframe> with overflow-y set to
      > auto. I can get a similar look with the <iframe> tag.
      >
      > BUT... In all cases I need to have fixed heights. Is there a way to
      > put either tag inside an HTML <TD> and have the same kind of
      > scrolling effect.
      >
      > This would allow me to fill the screen and have the size of the
      > scrolling box change on resize.[/color]

      I don't know what you mean. I think it is not a VB.NET language related
      question.


      --
      Armin




      Comment

      • Allard

        #4
        Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

        "Chris Barber" <chris@blue-canoe.co.uk.NOS PAM> wrote in
        news:#XZAo2K5DH A.1936@TK2MSFTN GP12.phx.gbl:
        [color=blue]
        > <table height="100%" width="100%" cellspacing="0" cellpadding="0" >
        > <tr>
        > <td>
        > <div style="width: 100%; height: 100%; overflow: auto;
        > border:
        > 1px solid red">
        > A div with text in it that will stat at 100% of the holding block
        > element size and also allow scrolling for off screen content.
        > A div with text in it that will stat at 100% of the holding block
        > element size and also allow scrolling for off screen content.
        > A div with text in it that will stat at 100% of the holding block
        > element size and also allow scrolling for off screen content.
        > A div with text in it that will stat at 100% of the holding block
        > element size and also allow scrolling for off screen content.
        > </div>
        > </td>
        > </tr>
        > </table>
        >
        > Border added for effect.
        >[/color]

        This only works in IE, but not in Mozilla browsers. (in mozilla the
        scrollbar never appears, because the element with height:100% seems to
        grow automatically.)

        Anyone knows how to do this in a uniform way?

        Allie

        Comment

        • Chris Barber

          #5
          Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

          Brilliant :(

          I am beginning to despair with HTML and browser specific implementations .

          Chris.

          "Allard" <spam@atarde.co m.br> wrote in message
          news:Xns947D5FE 0D3215allardata rdecombr@207.46 .248.16...
          "Chris Barber" <chris@blue-canoe.co.uk.NOS PAM> wrote in
          news:#XZAo2K5DH A.1936@TK2MSFTN GP12.phx.gbl:

          <snipped/>

          This only works in IE, but not in Mozilla browsers. (in mozilla the
          scrollbar never appears, because the element with height:100% seems to
          grow automatically.)

          Anyone knows how to do this in a uniform way?

          Allie


          Comment

          • Dave Anderson

            #6
            Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

            "Chris Barber" wrote:[color=blue]
            >
            > Brilliant :(
            >
            > I am beginning to despair with HTML and browser specific
            > implementations .[/color]

            First of all, it's a style issue, not an HTML one**. And this seems worthy
            of mention:

            "CSS1 core: UAs may ignore the 'height' property (i.e.,
            treat it as 'auto') if the element is not a replaced
            element."


            Since a DIV is not a replaced element, I don't see how you can reasonably
            expect uniformity.

            And that's just as well. Consider what the W3C says about style sheets:

            "By attaching style sheets to structured documents on the
            Web (e.g. HTML), authors and readers can influence the
            presentation of documents without sacrificing device-
            independence or adding new HTML tags."
            W3C's overview of Web style sheets.


            To me, the key word in that passage is INFLUENCE. I wouldn't get too worked
            up about standards-compliant discrepancies between implementations . This is
            a technology that should be *embraced* for its flexibility, not cursed.


            **Even if you want to consider the HTML HEIGHT attribute on your table, you
            have a problem. For one thing, the TABLE element has none. And for cells,
            it's deprecated:



            --
            Dave Anderson

            Unsolicited commercial email will be read at a cost of $500 per message. Use
            of this email address implies consent to these terms. Please do not contact
            me directly or ask me to contact you directly for assistance. If your
            question is worth asking, it's worth posting.



            Comment

            • Allard

              #7
              Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

              "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in
              news:u5GrOxN5DH A.504@TK2MSFTNG P11.phx.gbl:
              [color=blue]
              > "Chris Barber" wrote:[color=green]
              >>
              >> Brilliant :(
              >>
              >> I am beginning to despair with HTML and browser specific
              >> implementations .[/color]
              >
              > First of all, it's a style issue, not an HTML one**. And this seems
              > worthy of mention:
              >
              > "CSS1 core: UAs may ignore the 'height' property (i.e.,
              > treat it as 'auto') if the element is not a replaced
              > element."
              > http://www.w3.org/TR/CSS1#height
              >
              > Since a DIV is not a replaced element, I don't see how you can
              > reasonably expect uniformity.
              >
              > And that's just as well. Consider what the W3C says about style
              > sheets:
              >
              > "By attaching style sheets to structured documents on the
              > Web (e.g. HTML), authors and readers can influence the
              > presentation of documents without sacrificing device-
              > independence or adding new HTML tags."
              > http://www.w3.org/Style/
              >
              > To me, the key word in that passage is INFLUENCE. I wouldn't get too
              > worked up about standards-compliant discrepancies between
              > implementations . This is a technology that should be *embraced* for
              > its flexibility, not cursed.
              >
              >
              > **Even if you want to consider the HTML HEIGHT attribute on your
              > table, you have a problem. For one thing, the TABLE element has none.
              > And for cells, it's deprecated:
              > http://www.w3.org/TR/1998/REC-html40...les.html#edef-[/color]
              T[color=blue]
              > ABLE
              > http://www.w3.org/TR/1998/REC-html40...les.html#adef-[/color]
              h[color=blue]
              > eight-TH
              >[/color]

              That's all great, but how to do what we want then?

              Comment

              • Dave Anderson

                #8
                Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                "Allard" wrote:[color=blue]
                >
                > That's all great, but how to do what we want then?[/color]

                By "do what we want", do you mean "force the browser to display exactly as
                we desire"? If so, abandon that notion. You cannot reasonably expect the UA
                to even support styles, as some people turn them off (for accessibility or
                other reasons). Ditto for scripting.

                Consider the MSDN JScript Language Reference:
                Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


                When viewed in IE, the tree can be navigated without page reloads. When
                viewed in Mozilla, the tree navigation, while still possible, requires that
                the whole frameset reload. In Opera, there isn't even a frameset -- you see
                only the content pages, but no tree.

                And although site look and navigation is different for each browser, the
                core purpose of the JScript reference is still served. Isn't that the
                important thing?


                --
                Dave Anderson

                Unsolicited commercial email will be read at a cost of $500 per message. Use
                of this email address implies consent to these terms. Please do not contact
                me directly or ask me to contact you directly for assistance. If your
                question is worth asking, it's worth posting.


                Comment

                • Allard

                  #9
                  Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                  "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in
                  news:#T4L0TO5DH A.2344@TK2MSFTN GP09.phx.gbl:
                  [color=blue]
                  > "Allard" wrote:[color=green]
                  >>
                  >> That's all great, but how to do what we want then?[/color]
                  >
                  > By "do what we want", do you mean "force the browser to display
                  > exactly as we desire"? If so, abandon that notion. You cannot
                  > reasonably expect the UA to even support styles, as some people turn
                  > them off (for accessibility or other reasons). Ditto for scripting.
                  >
                  > Consider the MSDN JScript Language Reference:
                  > http://msdn.microsoft.com/library/en-[/color]
                  us/script56/html/js56jslrfjscrip tl[color=blue]
                  > anguagereferenc e.asp
                  >
                  > When viewed in IE, the tree can be navigated without page reloads.
                  > When viewed in Mozilla, the tree navigation, while still possible,
                  > requires that the whole frameset reload. In Opera, there isn't even a
                  > frameset -- you see only the content pages, but no tree.
                  >
                  > And although site look and navigation is different for each browser,
                  > the core purpose of the JScript reference is still served. Isn't that
                  > the important thing?
                  >[/color]

                  Correct, that is a nice example of browser specific implementations . For
                  example, in Mozilla the handling (and code) is different than for a IE
                  browser. I am sure they spent a lot of effort to make this in a uniform
                  way.

                  But the problem here is that we want to display something in the browser
                  that does not seem to be possible: if you have a table with two rows,
                  the first row is of fixed height, the second row should fill up the rest
                  of the screen. The content displayed in the second row should
                  automatically show scrollbars to be able to display all. The first row
                  should never scroll off screen. This in contrast of a big part of the
                  internet, where navigation buttons are scrolled off screen, which is
                  terribly ugly and user unfriendly. You must first scroll to navigate to
                  another page!?!?

                  Using the same approach as the example you gave, we could make a
                  different implementation for Mozilla browsers (using a frameset or so),
                  but of course this is not very easy to maintain.

                  Instead, how to display something like this on both browsers using HTML
                  and CSS?

                  The funny thing is that although IE might be inconsistent with the
                  specifications, it looks like it's the only browser that is capable of
                  showing user interfaces like the example earlier in this thread.

                  Appreciate your help,
                  Allie

                  Comment

                  • Dave Anderson

                    #10
                    Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                    "Allard" wrote:[color=blue]
                    >
                    > Using the same approach as the example you gave, we could
                    > make a different implementation for Mozilla browsers (using
                    > a frameset or so), but of course this is not very easy to
                    > maintain.[/color]

                    I intentionally chose an example that would highlight this point. I rigidly
                    oppose browser detection and the associated parallel development. But
                    choosing to write one version is necessarily a compromise. If I can't make
                    the application look and feel *exactly* the way I want to, then so be it.
                    Content is king, not design.

                    [color=blue]
                    > Instead, how to display something like this on both browsers
                    > using HTML and CSS?[/color]

                    If you are so bound to the "full-window" model that you cannot budge, you
                    can always accomplish it with frames:

                    <FRAMESET ROWS="(value of choice),*">

                    [color=blue]
                    > The funny thing is that although IE might be inconsistent with
                    > the specifications, it looks like it's the only browser that
                    > is capable of showing user interfaces like the example earlier
                    > in this thread.[/color]

                    It's the only browser you TESTED that does what you want within your a
                    priori established boundaries (no frames, for example).



                    --
                    Dave Anderson

                    Unsolicited commercial email will be read at a cost of $500 per message. Use
                    of this email address implies consent to these terms. Please do not contact
                    me directly or ask me to contact you directly for assistance. If your
                    question is worth asking, it's worth posting.


                    Comment

                    • Allard

                      #11
                      Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                      so....

                      according to the CSS specs, there is no general solution to do it with a
                      single HTML page? (if so, that would make me highly unsatisfied...)

                      A fullscreen solution indeed has my (and many ordinary users)
                      preference. In fact, only Internet websites have this browsing dilemma,
                      normal applications never have scrolling full screens. (I believe)

                      A frameset is possible, but would use multiple html pages, which is a
                      more difficult environment for scripts. What if I have a clientside
                      class that generated the HTML code, then I would need to put this code
                      in two frames, AND set the stylesheets in each frame.

                      I like your statement "content is kind, not design"... but in my opinion
                      it's not the way it should be... You should as a developer always be
                      able to show the content in a way you want, by simply defining the view.
                      If the view is the second row in a table like I described, then so be
                      it. That it will not be displayed 100% exactly the way you defined it on
                      every browser, ok, I can live with that, but at least a little bit close
                      would already be great...

                      :)

                      Allie

                      Comment

                      • Jim M

                        #12
                        Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                        Thanks for all the details, looks like I can try it tonight.



                        "Chris Barber" <chris@blue-canoe.co.uk.NOS PAM> wrote in message
                        news:%23XZAo2K5 DHA.1936@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                        > <table height="100%" width="100%" cellspacing="0" cellpadding="0" >
                        > <tr>
                        > <td>
                        > <div style="width: 100%; height: 100%; overflow: auto; border:
                        > 1px solid red">
                        > A div with text in it that will stat at 100% of the holding block element
                        > size and also allow scrolling for off screen content.
                        > A div with text in it that will stat at 100% of the holding block element
                        > size and also allow scrolling for off screen content.
                        > A div with text in it that will stat at 100% of the holding block element
                        > size and also allow scrolling for off screen content.
                        > A div with text in it that will stat at 100% of the holding block element
                        > size and also allow scrolling for off screen content.[/color]
                        </div>[color=blue]
                        > </td>
                        > </tr>
                        > </table>
                        >
                        > Border added for effect.
                        >
                        > Chris.
                        >
                        > "Jim M" <anonymouse@dis cussions.micros oft.com> wrote in message
                        > news:OHleONK5DH A.2572@TK2MSFTN GP09.phx.gbl...
                        > I have had great success with using <iframe> with overflow-y set to auto.[/color]
                        I[color=blue]
                        > can get a similar look with the <iframe> tag.
                        >
                        > BUT... In all cases I need to have fixed heights. Is there a way to put
                        > either tag inside an HTML <TD> and have the same kind of scrolling effect.
                        >
                        > This would allow me to fill the screen and have the size of the scrolling
                        > box change on resize.
                        >
                        > Thanks in advance.
                        >
                        > Jim
                        >
                        >
                        >[/color]


                        Comment

                        • Jim M

                          #13
                          Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                          I did want to add a few header title rows to your example. Thanks for the
                          example.

                          Is it correct to assume that there is no way to have 100px of header, and
                          then a scrolling <div> tag taking up "100% - 100px". It think this is the
                          root of my original question.

                          Or is there some way to set the <div> tag to be height = 100% or the size of
                          the <TD> container?

                          I am assuming there is no way based on ...

                          But the problem here is that we want to display something in the browser
                          that does not seem to be possible: if you have a table with two rows,
                          the first row is of fixed height, the second row should fill up the rest
                          of the screen. The content displayed in the second row should
                          automatically show scrollbars to be able to display all. The first row
                          should never scroll off screen. This in contrast of a big part of the
                          internet, where navigation buttons are scrolled off screen, which is
                          terribly ugly and user unfriendly. You must first scroll to navigate to
                          another page!?!?







                          "Allard" <spam@atarde.co m.br> wrote in message
                          news:Xns947D7DA C6E78Eallardata rdecombr@207.46 .248.16...[color=blue]
                          > "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in
                          > news:#T4L0TO5DH A.2344@TK2MSFTN GP09.phx.gbl:
                          >[color=green]
                          > > "Allard" wrote:[color=darkred]
                          > >>
                          > >> That's all great, but how to do what we want then?[/color]
                          > >
                          > > By "do what we want", do you mean "force the browser to display
                          > > exactly as we desire"? If so, abandon that notion. You cannot
                          > > reasonably expect the UA to even support styles, as some people turn
                          > > them off (for accessibility or other reasons). Ditto for scripting.
                          > >
                          > > Consider the MSDN JScript Language Reference:
                          > > http://msdn.microsoft.com/library/en-[/color]
                          > us/script56/html/js56jslrfjscrip tl[color=green]
                          > > anguagereferenc e.asp
                          > >
                          > > When viewed in IE, the tree can be navigated without page reloads.
                          > > When viewed in Mozilla, the tree navigation, while still possible,
                          > > requires that the whole frameset reload. In Opera, there isn't even a
                          > > frameset -- you see only the content pages, but no tree.
                          > >
                          > > And although site look and navigation is different for each browser,
                          > > the core purpose of the JScript reference is still served. Isn't that
                          > > the important thing?
                          > >[/color]
                          >
                          > Correct, that is a nice example of browser specific implementations . For
                          > example, in Mozilla the handling (and code) is different than for a IE
                          > browser. I am sure they spent a lot of effort to make this in a uniform
                          > way.
                          >
                          > But the problem here is that we want to display something in the browser
                          > that does not seem to be possible: if you have a table with two rows,
                          > the first row is of fixed height, the second row should fill up the rest
                          > of the screen. The content displayed in the second row should
                          > automatically show scrollbars to be able to display all. The first row
                          > should never scroll off screen. This in contrast of a big part of the
                          > internet, where navigation buttons are scrolled off screen, which is
                          > terribly ugly and user unfriendly. You must first scroll to navigate to
                          > another page!?!?
                          >
                          > Using the same approach as the example you gave, we could make a
                          > different implementation for Mozilla browsers (using a frameset or so),
                          > but of course this is not very easy to maintain.
                          >
                          > Instead, how to display something like this on both browsers using HTML
                          > and CSS?
                          >
                          > The funny thing is that although IE might be inconsistent with the
                          > specifications, it looks like it's the only browser that is capable of
                          > showing user interfaces like the example earlier in this thread.
                          >
                          > Appreciate your help,
                          > Allie[/color]


                          Comment

                          • Chris Barber

                            #14
                            Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                            OK,

                            I'll be the first to admit that I'm not an expert web designer / developer
                            but I have produced web 'applications' for intranet and internet where the
                            vagaries of different browser (whether or not they are HTML / CSS compliant)
                            becomes a minefield that can produce very strange and worrying effects. I
                            had
                            at least one instance on a MAC where the page returned as a complete blank
                            with full source still visible (eg. View Source).

                            I don't even know what a 'replaced' element is and certainly I don't have
                            the time, energy, or inclination to go and check every usage on an HTML
                            element, attribute or CSS application whether it be a stylesheet or style
                            attribute.

                            Now, please don;t get me wrong, I'm not ranting, nor am I flaming your
                            response. I'm merely trying to show the level of frustration that
                            accompanies any form of web based development no matter how experienced one
                            might be. I'd probably put myself across as an 'Advanced' web developer
                            given that I've successfully done DHTML, XSLT,. XML, Javascript, and fairly
                            complex layouts with attendant CSS. However, it still pi**es me off when my
                            best efforts turn out to be garbage on anything other than IE 5.5+ or
                            Mozilla (I *like* Mozilla a lot). Certainly trying to get anything even
                            remotely complex or interactive to work
                            with Netscape or the Mac (Safari) is almost impossible.

                            Regards,

                            Chris.

                            "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in message
                            news:u5GrOxN5DH A.504@TK2MSFTNG P11.phx.gbl...
                            "Chris Barber" wrote:[color=blue]
                            >
                            > Brilliant :(
                            >
                            > I am beginning to despair with HTML and browser specific
                            > implementations .[/color]

                            First of all, it's a style issue, not an HTML one**. And this seems worthy
                            of mention:

                            "CSS1 core: UAs may ignore the 'height' property (i.e.,
                            treat it as 'auto') if the element is not a replaced
                            element."


                            Since a DIV is not a replaced element, I don't see how you can reasonably
                            expect uniformity.

                            And that's just as well. Consider what the W3C says about style sheets:

                            "By attaching style sheets to structured documents on the
                            Web (e.g. HTML), authors and readers can influence the
                            presentation of documents without sacrificing device-
                            independence or adding new HTML tags."
                            W3C's overview of Web style sheets.


                            To me, the key word in that passage is INFLUENCE. I wouldn't get too worked
                            up about standards-compliant discrepancies between implementations . This is
                            a technology that should be *embraced* for its flexibility, not cursed.


                            **Even if you want to consider the HTML HEIGHT attribute on your table, you
                            have a problem. For one thing, the TABLE element has none. And for cells,
                            it's deprecated:



                            --
                            Dave Anderson

                            Unsolicited commercial email will be read at a cost of $500 per message. Use
                            of this email address implies consent to these terms. Please do not contact
                            me directly or ask me to contact you directly for assistance. If your
                            question is worth asking, it's worth posting.





                            Comment

                            • Allard

                              #15
                              Re: Variable length scrolling &lt;div&gt; or &lt;iframe&g t;?

                              I can seen nothing else than: " I totally agree..."

                              I am still curious though to know what the h*ll a replaced element is ....
                              :)

                              Allie

                              Comment

                              Working...