Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Workaround wanted

Workaround wanted

Scheduled Pinned Locked Moved Web Development
dockerhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jan larsen
    wrote on last edited by
    #1

    I've spent quite some time developing a table component which makes output like this:

    <div style="width: 100%; overflow: scroll;">
    <table>
    <tr>
    <td style="width: 100px;"> Column 1 </td>
    <td style="width: 100px;"> Column 2 </td>
    <td style="width: 100px;"> Column 3 </td>
    </tr>
    </table>
    </div>

    The idea is that the table will take up as much space as it can, and have scrollbars when column widths overflow container size. It works great when added directly in the body tag, but if I put it inside a td tag, IE suddenly allows the div and table to expand, even if the parenting table and td are also set to 100% width. I'm too lazy to look it up, but it doesn't make sense, and it works in Mozilla so it must be a bug in IE. Whatever it is, I need to make it function, so does anybody know a workaround? "God doesn't play dice" - Albert Einstein "God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr

    M 1 Reply Last reply
    0
    • J jan larsen

      I've spent quite some time developing a table component which makes output like this:

      <div style="width: 100%; overflow: scroll;">
      <table>
      <tr>
      <td style="width: 100px;"> Column 1 </td>
      <td style="width: 100px;"> Column 2 </td>
      <td style="width: 100px;"> Column 3 </td>
      </tr>
      </table>
      </div>

      The idea is that the table will take up as much space as it can, and have scrollbars when column widths overflow container size. It works great when added directly in the body tag, but if I put it inside a td tag, IE suddenly allows the div and table to expand, even if the parenting table and td are also set to 100% width. I'm too lazy to look it up, but it doesn't make sense, and it works in Mozilla so it must be a bug in IE. Whatever it is, I need to make it function, so does anybody know a workaround? "God doesn't play dice" - Albert Einstein "God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi Jan, In the style of the parent table, you simply set the table-layout property to fixed:

      <TABLE width="100%" style="TABLE-LAYOUT: fixed; WIDTH: 100%" ...>

      J 1 Reply Last reply
      0
      • M minhpc_bk

        Hi Jan, In the style of the parent table, you simply set the table-layout property to fixed:

        <TABLE width="100%" style="TABLE-LAYOUT: fixed; WIDTH: 100%" ...>

        J Offline
        J Offline
        jan larsen
        wrote on last edited by
        #3

        Thanks! It's working perfectly. :-D "God doesn't play dice" - Albert Einstein "God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups