You can possibly have some default hidden text in a div and measure the clientWidth or offsetWidth CSS property of it using javascript, but its no practical use in predicting the width of the text you *want* to show.
The only way I can think of is to use fixed width fonts (ugh!) like system fonts defaultly used inside <PRE> or <TEXTAREA> tags. Of course, users can specify their own stylesheet overriding anything you might choose to use. Unlucky !
So, IMO I would have to say no. Bet plan is to make a good guess and keep your fingers crossed.
Any particular reason you might want to do this ? The trend with the web in any case is to go for fluid layout for different browser types, platforms and even devices (iPaq, mobile browsers, CE machines), and so its probably justified.
HTH Neil Smith.
At 08:13 20/03/2003 +0000, you wrote:
---------------------------------------------------------------------- Message-ID: <[EMAIL PROTECTED]> From: "Bobo Wieland" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Date: Wed, 19 Mar 2003 22:29:22 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Subject: Calculationg lines of text
When you're dealing with layout w text and images in documents on the web, where the text/images is updatable by the client, it would be nice to be able to calulate lines of text and charachters per line. Is there some way to do this in php? If not, is it possible in some other language? Javascript, maybe?
.bobo
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php