Computer Science Canada

textarea size

Author:  da_foz [ Tue Mar 01, 2005 4:03 pm ]
Post subject:  textarea size

Ok, I have a textarea.
It is the only thing in a table cell.
I want it to always be 8 rows high, so I have that set.

For the width, I was to to be as wide as the cell, how do I do this?
I can't just set the cols because what about different screen resolutions.
The textarea is part of a form.

Any ideas?

Thanks

Author:  Blade [ Tue Mar 01, 2005 5:16 pm ]
Post subject: 

what if you take some sort of programming language then calculate the number of cols according to screen resolution.. maybe use javascript? you can use that to get their resolution. iam not sure if you can put a javascript variable in the textarea's cols, but you can probably use a function to change the size of it on the pageload

Author:  da_foz [ Tue Mar 01, 2005 5:52 pm ]
Post subject: 

I was afraid someone was going to say something like that:P

There is no JS in this project as of now and I rather stay away from it if at all possible.

Author:  Lazarus [ Sat Apr 23, 2005 4:52 pm ]
Post subject: 

I would say either a WYSIWYG editor or would you like an example code?

Author:  wtd [ Sat Apr 23, 2005 5:08 pm ]
Post subject: 

Or you could use CSS, for crying out loud. I don't understand what you people have against style sheets.

code:
width: 100%;

Author:  md [ Sat Apr 23, 2005 7:10 pm ]
Post subject: 

If your not using stylesheets, then you're probably breaking all sorts of standards... I'd try doing it with xhtml, and stylesheets as wtd suggested, but then it isn't quite plain what your doing, so maybe stylesheets are out of the question

Author:  wtd [ Sat Apr 23, 2005 7:33 pm ]
Post subject: 

You're going to have to research no matter what approach you take, but I don't see it getting anymore intuitive than:

code:
width: 100%;


: