[thelist] stopping text overflow in a div

getafixx at getafixx.com getafixx at getafixx.com
Mon Dec 13 08:15:31 CST 2004


Hello

I am trying to figure out a way of figuring out if a div with formatted (or
even unformatted) text has too much text for the div size and the current
font size / formatting.

A simple test is located at
http://www.getafixx.com/temp/flow_control_test.html and how I would like it
to be over 3 pages is shown here
http://www.getafixx.com/temp/flow_control_correct.html

The shape and sizes of the div is just for the example.

basically if too much text is added into a div I get text overflow. How can
I know when I am close to filling up a div and trying to work out how many
"pages" in the div to divide up the text into. so that I can dynamically
write a "page X of Y" with next and prev buttons.

I am a good PHP coder, but seam to be getting stumped on this one and I
can't seam to find any answers to my questions from Google.

I assume that I will be reading said text from a database, and I assume that
I could put in some sort of page markers (strange characters) into the text,
to be parsed as I read, but there must be some way of doing this without too
much human intervention.

Thanks

Justin





More information about the thelist mailing list