By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

textarea automatic resize and proportional fonts

P: n/a
Hi,

I have been experimenting with some textarea automatic resize scripts.
Most that I have found count the number of characters in the textarea
and divide by the number of columns. This works will with monospaced
fonts or with just wide letters like 'M'. However if I fill the text
area with proportional font 'i' characters then a lot of white space
builds up at the end of the text area. Is there a way to account for
proportional fonts to avoid this whitespace?

Thanks,
Peter

Jul 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ivo
<pe**********@gmail.comschreef
I have been experimenting with some textarea automatic resize scripts.
Most that I have found count the number of characters in the textarea
and divide by the number of columns. This works will with monospaced
fonts or with just wide letters like 'M'. However if I fill the text
area with proportional font 'i' characters then a lot of white space
builds up at the end of the text area. Is there a way to account for
proportional fonts to avoid this whitespace?
Sounds not very userfriendly to me. You could try creating a selection of
the text in the area, read the boundingwidth, -height, -left and -top of the
selection range object thing, that would give you the exact dimension of the
textblock, at least in some browsers, but I 'd rather you leave my textarea
alone, frankly. Or provide a means for me to drag it to the size I like.
Like some other scripts out there demonstrate.
hth
ivo
Jul 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.