Jump to content

Help with table data overflowing outside it's containing div


Darkmatter5

Recommended Posts

Here's my code

<div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em; max-height: 200px;'>
  <table width='100%' height='100%' cellpadding='2' cellspacing='0' border='0' style='table-layout: fixed;'>
    <tr><th style='border-bottom: 2px groove #F0FFF0;'>CHARACTER SHEET HELP </th></tr>
    <tr valign='top'><td style='overflow-y: auto;'>                      
      <ol>Acronyms
        <li>Str: Strength</li>
        <li>Dex: Dexterity</li>
        <li>Con: Constitution</li>
        <li>Int: Intelligence</li>
        <li>Wis: Wisdom</li>
        <li>Cha: Charisma</li>
        <li>Mod: Modifier</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
        <li>Equip: Equipment</li>
      </ol>
    </td></tr>
  </table>
  <div class='corner topLeft'></div>
  <div class='corner topRight'></div>
  <div class='corner bottomLeft'></div>
  <div class='corner bottomRight'></div>
</div>

 

Thanks in advance!

 

[attachment deleted by admin]

Link to comment
Share on other sites

Removing max-height makes the div grow as new contents is added, I need it fixed to grow no more then 200.  Adding overflow-y: scroll to the div produces a scroll bar, but I need the scroll bar to be in the <td> tag of the table, not the div.

 

Attached is a screen of the following code

"<div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em; overflow-y: scroll;'>"

 

How can I only scroll within the <td>?

 

[attachment deleted by admin]

Link to comment
Share on other sites

I got it working with this code:

 

<div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em;'>
  <table width='100%' height='100%' cellpadding='2' cellspacing='0' border='0'>
    <tr><th style='border-bottom: 2px groove #F0FFF0;'>CHARACTER SHEET HELP </th></tr>
    <tr valign='top'><td height='200'>
      <div style='overflow-y: auto; height: 200px;'>
      <b>Acronyms</b>
      <ol>
        <li>Bon = Bonus</li>
        <li>Cha = Charisma</li>
        <li>Con = Constitution</li>
        <li>Dex = Dexterity</li>
        <li>Equip = Equipment</li>
        <li>Int = Intelligence</li>
        <li>Misc = Miscellaneous</li>
        <li>Mod = Modifier</li>
        <li>Pen = Penalty</li>
        <li>Str = Strength</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
        <li>Wis = Wisdom</li>
      </ol>
      </div>
    </td></tr>
  </table>
  <div class='corner topLeft'></div>
  <div class='corner topRight'></div>
  <div class='corner bottomLeft'></div>
  <div class='corner bottomRight'></div>
</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.