OsakaWebbie
Programmer
I want to create a child window for editing the content of the parent, with a big textarea that will fill as much of the window as possible (except for a little spot for Apply and Reset buttons). The problem is that window sizes are in pixels, but textarea sizes are in rows and cols. The textarea properties clientHeight and clientWidth are in pixels, but appear to be just informational (read-only). The only way I can think of to get the size right is to create the window and the textarea with some starting size that is a guess, and then have a loop where I test clientHeight and clientWidth against the window size and change rows and/or cols accordingly, over and over, until it fits. That seems cheesy. Is there a better way?
I will be specifying my textarea's font-size in CSS, but I like using "pt" for font sizes, and I suspect that the ratio between points, pixels, and textarea rows/cols varies by browser. Even if I used "px" instead, that would only help define the height - the width of a character in the fixed-spaced font of the browser would still be an unknown.
I will be specifying my textarea's font-size in CSS, but I like using "pt" for font sizes, and I suspect that the ratio between points, pixels, and textarea rows/cols varies by browser. Even if I used "px" instead, that would only help define the height - the width of a character in the fixed-spaced font of the browser would still be an unknown.