Fill CSS box with text from MySQL till there is no overflow, scrollbar, or hidden text

Posted by terrance branigan on Stack Overflow See other posts from Stack Overflow or by terrance branigan
Published on 2010-06-16T00:18:56Z Indexed on 2010/06/16 0:22 UTC
Read the original article Hit count: 604

Filed under:
|
|
|

I want to fill a CSS box with text till there is no overflow or scrollbar. I fetch text from MySQL. The user clicks a button and the next bit of text that can fit will fill the box. The only way I've figured to do this is by parsing through the text and counting characters and newlines, etc and calculating whether it will fit in the box. Is there an easier way to do this? Thank you

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript