Fixed width div/textarea with no scroll bars needs to expand to content

Hi Experts,

 I have some dynamic text content that I need to echo. I want it to fill a space 580px in width. Should the content exceed 580 it needs to wrap and expand either the div or the texarea. I have got this to work using a textarea and wrap="virtual' in Safari but it produces on long line of text and a scroll bar in FF and IE.
I have tried max-width but that only works in Saf too.
Is this possible? It seems basic but i can't seem to find an example that works in the knowledge base.

Thanks for any help.
RowdyBurnsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

spikeyman00Commented:
This is what someone else posted on here.

<HTML>

<head>

<script>
function MakeSizeAdjustment(oTextArea)
{
      if (navigator.appName.indexOf("Microsoft Internet Explorer") == 0)
      {
            return;
      }

      while (oTextArea.scrollHeight > oTextArea.offsetHeight)
      {
            oTextArea.rows++;
      }
}
</script>

</head>

<BODY>

The amazing, incredible, expanding text-area:
<textarea style="overflow:visible;width:30%" rows="3" onkeyup="MakeSizeAdjustment(this)">Some Test Text</textarea>

</BODY>
</HTML>
0
RowdyBurnsAuthor Commented:
EEErm. This still displays scroll bars in FF.
0
scrathcyboyCommented:
DIVS and text areas will ALWAYS show scroll bars if the content exceeds the DIV height -- with DIVs you can elminate the scroll bars with --

DIV {scroll-y:no; scroll-x:no;}

with text area, you cannot solve this.  Why not just use a table?  If the user can't edit the content, just put it in a table and the table cell will automatically fill the table and wrap correctly without ANY scroll bars --

<TABLE width="580">
  <TR>
     <TD width="580"> content here </TD>
  </TR>
</TABLE>

that is guaranteed to work, no matter how big the content is.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RowdyBurnsAuthor Commented:
Thank you for having a look at this.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.