Dynamic Table Issue

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

    Dynamic Table Issue


    I am writing a table out to display data from a recordset and my problem is that even though as you can see the table should not exceed that screen size, it does. My users will have to scroll a mile to the right to see the right most column...
    Any ideas? I have already tried using width specifiers on each <td></td> and it doesn't help, what am I missing here?

    Response.Write "<table border='1' width='100%'>" ' should do the trick!!!!

    I am doing the usual..

    Do While Not objRS.EOF
    Response.Write( "<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num") & "</font>" & "</td>" ) & vbCr

    I know I should be using css.. anyway whats wrong with my table above???



  • Curt_C [MVP]

    #2
    Re: Dynamic Table Issue

    what's in the table cell? Do you have a long, unbreakable, string?

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software



    "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
    news:F16D0E6B-09A3-4F85-87D4-8597CE352C60@mi crosoft.com...[color=blue]
    >
    > I am writing a table out to display data from a recordset and my problem[/color]
    is that even though as you can see the table should not exceed that screen
    size, it does. My users will have to scroll a mile to the right to see the
    right most column...[color=blue]
    > Any ideas? I have already tried using width specifiers on each <td></td>[/color]
    and it doesn't help, what am I missing here?[color=blue]
    >
    > Response.Write "<table border='1' width='100%'>" ' should do the trick!!!!
    >
    > I am doing the usual..
    >
    > Do While Not objRS.EOF
    > Response.Write( "<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num")[/color]
    & "</font>" & "</td>" ) & vbCr[color=blue]
    >
    > I know I should be using css.. anyway whats wrong with my table above???
    >
    >
    >[/color]


    Comment

    • Jeff Cochran

      #3
      Re: Dynamic Table Issue

      On Mon, 29 Mar 2004 06:56:06 -0800, HenryW
      <anonymous@disc ussions.microso ft.com> wrote:
      [color=blue]
      >
      >I am writing a table out to display data from a recordset and my problem is that even though as you can see the table should not exceed that screen size, it does. My users will have to scroll a mile to the right to see the right most column...
      >Any ideas? I have already tried using width specifiers on each <td></td> and it doesn't help, what am I missing here?
      >
      >Response.Wri te "<table border='1' width='100%'>" ' should do the trick!!!!
      >
      >I am doing the usual..
      >
      >Do While Not objRS.EOF
      >Response.Write ("<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num") & "</font>" & "</td>" ) & vbCr
      >
      >I know I should be using css.. anyway whats wrong with my table above???[/color]

      Nothing from an ASP aspect. :)

      You'll want to follow up in a HTML or other client-side group, but my
      guess would be you have a long string of characters that won't or
      isn't wrapping in the cell. Using a fixed width on each column should
      work, though it can be clunky.

      From an ASP aspect (to stay on topic) you can write a routine that
      does a character count and wraps long strings so they fit in table
      cells. I saw a function for this somewhere but I don't have a link
      and I don't use this in what I do, you could probably find something
      on aspin.com or the like.

      Jeff

      Comment

      • Aaron Bertrand [MVP]

        #4
        Re: Dynamic Table Issue

        So, what is in objRS("co_num") ? Can we see a demonstration of this
        somewhere?

        --
        Aaron Bertrand
        SQL Server MVP



        "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
        news:F16D0E6B-09A3-4F85-87D4-8597CE352C60@mi crosoft.com...[color=blue]
        >
        > I am writing a table out to display data from a recordset and my problem
        > is that even though as you can see the table should not exceed that screen
        > size, it does. My users will have to scroll a mile to the right to see the
        > right most column...
        > Any ideas? I have already tried using width specifiers on each <td></td>
        > and it doesn't help, what am I missing here?
        >
        > Response.Write "<table border='1' width='100%'>" ' should do the trick!!!!
        >
        > I am doing the usual..
        >
        > Do While Not objRS.EOF
        > Response.Write( "<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num")
        > & "</font>" & "</td>" ) & vbCr
        >
        > I know I should be using css.. anyway whats wrong with my table above???
        >
        >
        >[/color]


        Comment

        • Curt_C [MVP]

          #5
          Re: Dynamic Table Issue

          not really.
          It will not break a long word, only breaks between words

          --
          Curt Christianson
          Owner/Lead Developer, DF-Software



          "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
          news:0827D785-802C-4A2D-8F22-4ABC12927C43@mi crosoft.com...[color=blue]
          > Yes there are some long strings but they should wrap to the table cell as[/color]
          opposed to extending out to the right a mile... That's what I thought
          setting the table width as 100% would do....[color=blue]
          > Thanks for your help![/color]


          Comment

          • Aaron Bertrand [MVP]

            #6
            Re: Dynamic Table Issue

            Nor will it break the following, if there are no carriage returns:

            <pre> ... long text here with spaces ... </pre>

            --
            Aaron Bertrand
            SQL Server MVP



            "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
            news:uUZDHxaFEH A.1600@tk2msftn gp13.phx.gbl...[color=blue]
            > not really.
            > It will not break a long word, only breaks between words
            >
            > --
            > Curt Christianson
            > Owner/Lead Developer, DF-Software
            > www.Darkfalz.com
            >
            >
            > "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
            > news:0827D785-802C-4A2D-8F22-4ABC12927C43@mi crosoft.com...[color=green]
            >> Yes there are some long strings but they should wrap to the table cell as[/color]
            > opposed to extending out to the right a mile... That's what I thought
            > setting the table width as 100% would do....[color=green]
            >> Thanks for your help![/color]
            >
            >[/color]


            Comment

            • Curt_C [MVP]

              #7
              Re: Dynamic Table Issue

              aye...and to add to it there are MANY tags, that if embeded in that string,
              that will cause it not to "break"

              --
              Curt Christianson
              Owner/Lead Developer, DF-Software



              "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
              news:O5Bfv1aFEH A.3252@TK2MSFTN GP11.phx.gbl...[color=blue]
              > Nor will it break the following, if there are no carriage returns:
              >
              > <pre> ... long text here with spaces ... </pre>
              >
              > --
              > Aaron Bertrand
              > SQL Server MVP
              > http://www.aspfaq.com/
              >
              >
              > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
              > news:uUZDHxaFEH A.1600@tk2msftn gp13.phx.gbl...[color=green]
              > > not really.
              > > It will not break a long word, only breaks between words
              > >
              > > --
              > > Curt Christianson
              > > Owner/Lead Developer, DF-Software
              > > www.Darkfalz.com
              > >
              > >
              > > "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
              > > news:0827D785-802C-4A2D-8F22-4ABC12927C43@mi crosoft.com...[color=darkred]
              > >> Yes there are some long strings but they should wrap to the table cell[/color][/color][/color]
              as[color=blue][color=green]
              > > opposed to extending out to the right a mile... That's what I thought
              > > setting the table width as 100% would do....[color=darkred]
              > >> Thanks for your help![/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • HenryW

                #8
                Re: Dynamic Table Issue


                All the lines that write to the table look just like this... is there anything there that would cause it to fail to break?

                Response.Write( "<td><font face=""Verdana" " size=""2"">" & objRS("co_desc" ) & "</font>" & "</td>") & vbCr

                Comment

                • William Morris

                  #9
                  Re: Dynamic Table Issue

                  Henry,

                  Try the styles below and see what you come up with.

                  You'll also make your life so much easier if you stop using the <FONT> tag,
                  and use stylesheets instead.

                  <table class='myTable' >...

                  <style>
                  table.myTable {
                  table-layout: fixed;
                  width: 800px; /* << change this to fit */
                  }
                  td {
                  font-family: verdana, arial, sans-serif;
                  font-size: 2;
                  width: 100px; /* optional, whatever value peels your banana */
                  }
                  </style>

                  As recommended reading, may I direct your attention to
                  http://www.alistapart.com.

                  Slainte!

                  --
                  William Morris
                  Semster/Webmaster, Seamlyne reProductions
                  Visit our website, http://www.seamlyne.com, for the most comfortable
                  historically inspired clothing you can buy!

                  "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
                  news:F16D0E6B-09A3-4F85-87D4-8597CE352C60@mi crosoft.com...[color=blue]
                  >
                  > I am writing a table out to display data from a recordset and my problem[/color]
                  is that even though as you can see the table should not exceed that screen
                  size, it does. My users will have to scroll a mile to the right to see the
                  right most column...[color=blue]
                  > Any ideas? I have already tried using width specifiers on each <td></td>[/color]
                  and it doesn't help, what am I missing here?[color=blue]
                  >
                  > Response.Write "<table border='1' width='100%'>" ' should do the trick!!!!
                  >
                  > I am doing the usual..
                  >
                  > Do While Not objRS.EOF
                  > Response.Write( "<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num")[/color]
                  & "</font>" & "</td>" ) & vbCr[color=blue]
                  >
                  > I know I should be using css.. anyway whats wrong with my table above???
                  >
                  >
                  >[/color]


                  Comment

                  • Curt_C [MVP]

                    #10
                    Re: Dynamic Table Issue

                    header row perhaps?
                    The sentence will break, and from the look of it there is nothing in that
                    one cell.... look down the entire page though, if any ONE
                    line/header/footer/etc has a long, unbroken, work/number/etc then it will do
                    this.

                    --
                    Curt Christianson
                    Owner/Lead Developer, DF-Software



                    "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
                    news:6093FC84-F936-4B2F-BB18-2B5EC153F973@mi crosoft.com...[color=blue]
                    >
                    > All the lines that write to the table look just like this... is there[/color]
                    anything there that would cause it to fail to break??[color=blue]
                    >
                    > Response.Write( "<td><font face=""Verdana" " size=""2"">" &[/color]
                    objRS("co_desc" ) & "</font>" & "</td>") & vbCr


                    Comment

                    • Curt_C [MVP]

                      #11
                      Re: Dynamic Table Issue

                      do a HTMLEncode() around the RS result once

                      --
                      Curt Christianson
                      Owner/Lead Developer, DF-Software



                      "HenryW" <anonymous@disc ussions.microso ft.com> wrote in message
                      news:BF8610FD-D8DD-41B3-B5F6-D0CD0F35E4DE@mi crosoft.com...[color=blue]
                      > "Using a fixed width on each column should
                      > work, though it can be clunky."
                      >
                      > This did not work. I was fairly confident it was an ASP/recordset issue as[/color]
                      I have never had a table set to 100% fail to display in a window.[color=blue]
                      > In the HTML that results from my code, the table tag is in there, set to[/color]
                      100%... on some queries using the same code it will display just fine, ie,
                      on a single page word wrapping appropriately.. . but on other records, with
                      more data, it will not wrap and then extends out to the right a long ways.
                      It's like a vertical cell size maximum gets hit and then it won't wrap...
                      ofcourse I know of no such maximun....


                      Comment

                      • Stefan Berglund

                        #12
                        Re: Dynamic Table Issue

                        On Mon, 29 Mar 2004 06:56:06 -0800, HenryW
                        <anonymous@disc ussions.microso ft.com> wrote:
                        in <F16D0E6B-09A3-4F85-87D4-8597CE352C60@mi crosoft.com>
                        [color=blue]
                        >
                        >I am writing a table out to display data from a recordset and my problem is that even though as you can see the table should not exceed that screen size, it does. My users will have to scroll a mile to the right to see the right most column...
                        >Any ideas? I have already tried using width specifiers on each <td></td> and it doesn't help, what am I missing here?
                        >
                        >Response.Wri te "<table border='1' width='100%'>" ' should do the trick!!!!
                        >
                        >I am doing the usual..
                        >
                        >Do While Not objRS.EOF
                        >Response.Write ("<tr><td><f ont face='Verdana' size='2'>" & objRS("co_num") & "</font>" & "</td>" ) & vbCr
                        >
                        >I know I should be using css.. anyway whats wrong with my table above???
                        >
                        >[/color]

                        What happens when you add a </tr> right after the </td> ?

                        ---
                        Stefan Berglund
                        first shift-minus last a t m s n d o t c o m

                        Comment

                        • HenryW

                          #13
                          Re: Dynamic Table Issue

                          I have got one on the last Reposnse.Write row ... <td></td></tr
                          The style tag reply was what got me going again, and thanks for your input!

                          Comment

                          • Jeff Cochran

                            #14
                            Re: Dynamic Table Issue

                            On Mon, 29 Mar 2004 09:11:10 -0800, HenryW
                            <anonymous@disc ussions.microso ft.com> wrote:
                            [color=blue]
                            >All the lines that write to the table look just like this... is there anything there that would cause it to fail to break??
                            >
                            >Response.Write ("<td><font face=""Verdana" " size=""2"">" & objRS("co_desc" ) & "</font>" & "</td>") & vbCr[/color]

                            Sure. If objRS("co_desc" ) turns out to be:

                            wuebckrjlbryxfl bulbxyxblarfylb aruyflbxrugyxbr guyxruyxugxynur gnblrtiugylriug ynxriugynruexgy brluyexgkuxyelg buxyrglbexgylbx eugylerugxyergn xyegnelrugyxleu rgbxeugxe

                            Then you'll get a cell that width.

                            And I'm not sure even HTML.Encode would solve that issue well enough.
                            Non-breaking spaces would be the same issue.

                            Jeff

                            Comment

                            Working...