HighDots Forums  

purpose of cols / rows in textarea

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss purpose of cols / rows in textarea in the HTML forum.

Reply
 
Thread Tools Display Modes
  #1  
Old   
yawnmoth
 
Posts: n/a

Default purpose of cols / rows in textarea - 03-26-2009 , 12:49 PM






Why are cols and rows required attributes for the textarea element?
Seems like that's something that ought to be determined with CSS - not
with hard-coded HTML attributes. Also, there doesn't seem to be much
of a correlation between cols / rows and the height / width of a
textarea. For example,

http://www.htmlcodetutorial.com/form...AREA_COLS.html

In the first textarea, I can place the letter a twelve times
horizontally and three times vertically. Wouldn't that make it 3x12
and not 2x10?



Reply With Quote
  #2  
Old   
Andy Dingley
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 12:54 PM






On 26 Mar, 18:49, yawnmoth <terra1... (AT) yahoo (DOT) com> wrote:
Quote:
Why are cols and rows required attributes for the textarea element?
As a guess, because they were required in HTML 3.2

Quote:
Seems like that's something that ought to be determined with CSS
Agreed.




Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 01:03 PM



yawnmoth wrote:

Quote:
Why are cols and rows required attributes for the textarea element?
The HTML specifications tell that.

Quote:
Seems like that's something that ought to be determined with CSS - not
with hard-coded HTML attributes.
And what happens when CSS off?

When CSS is on and you specify width and height for a textarea, the cols and
rows attribute have no effect, so why wouldn't you use them to specify the
dimensions as a fallback.

Quote:
Also, there doesn't seem to be much
of a correlation between cols / rows and the height / width of a
textarea.
There is.

Quote:
In the first textarea, I can place the letter a twelve times
horizontally and three times vertically. Wouldn't that make it 3x12
and not 2x10?
I'm not sure what you mean by that, but the cols attribute specifies the
width in terms of "average-width" characters, and this vague concept means
different things in different situations. Note however that CSS has _no_
such concept.

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #4  
Old   
Swifty
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 01:20 PM



Quote:
In the first textarea, I can place the letter a twelve times
horizontally and three times vertically. Wouldn't that make it 3x12
and not 2x10?

I'm not sure what you mean by that, but the cols attribute specifies the
width in terms of "average-width" characters, and this vague concept
means different things in different situations. Note however that CSS
has _no_ such concept.
I believe it makes the box large enough to be able to display the
specified number of rows and columns even when the user types sufficient
text to cause scrollbars to appear.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


Reply With Quote
  #5  
Old   
Ed Mullen
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 01:48 PM



yawnmoth wrote:
Quote:
Why are cols and rows required attributes for the textarea element?
Seems like that's something that ought to be determined with CSS - not
with hard-coded HTML attributes. Also, there doesn't seem to be much
of a correlation between cols / rows and the height / width of a
textarea. For example,

http://www.htmlcodetutorial.com/form...AREA_COLS.html

In the first textarea, I can place the letter a twelve times
horizontally and three times vertically. Wouldn't that make it 3x12
and not 2x10?
Interestingly, in every size textarea I created it displayed exactly 2
more characters than the COLS spec.

--
Ed Mullen
http://edmullen.net
Deja Loo: I've heard this flush before!


Reply With Quote
  #6  
Old   
Ed Mullen
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 03:45 PM



Ed Mullen wrote:
Quote:
yawnmoth wrote:
Why are cols and rows required attributes for the textarea element?
Seems like that's something that ought to be determined with CSS - not
with hard-coded HTML attributes. Also, there doesn't seem to be much
of a correlation between cols / rows and the height / width of a
textarea. For example,

http://www.htmlcodetutorial.com/form...AREA_COLS.html

In the first textarea, I can place the letter a twelve times
horizontally and three times vertically. Wouldn't that make it 3x12
and not 2x10?

Interestingly, in every size textarea I created it displayed exactly 2
more characters than the COLS spec.

Oops. Forgot the example:

http://edmullen.net/temp/textarea.php

SeaMonkey, Firefox 2 - No initial scroll bars and each box shows all
characters. No horizontal scroll bar until one more character is added.

Opera - First textarea has vertical scroll bar and displays only 5 of 7
characters. Next two have vertical and horizontal scroll bars.
Deleting two characters in the 2nd and 3rd boxes removes the horizontal
scroll bars.

IE7 - Vertical scroll bars initially present. Exactly two characters
wrap to next line.

Safari - Initial display of 1st box shows 7 characters. 2nd box wraps 2
characters to next line. 3rd box shows all 52 characters. Safari
provides a handle in the lower right to grab, drag and resize the boxes.

Very interesting how the different designers decided to handle this.

--
Ed Mullen
http://edmullen.net
After eating, do amphibians have to wait one hour before getting out of
the water?


Reply With Quote
  #7  
Old   
Irina Rempt
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 04:05 PM



On Thursday 26 March 2009 20:20, Swifty wrote:

[cols and rows in textarea]

Quote:
I believe it makes the box large enough to be able to display the
specified number of rows and columns even when the user types sufficient
text to cause scrollbars to appear.
I'd love to have a textarea that changed size with its containing div on
browser resize instead of staying stubbornly its [cols] width even if that
means it overlaps the sidebar.

Irina

--
"Of course it is happening inside your head, Harry, but why on earth
should that mean that it is not real?" --Albus Dumbledore
http://www.valdyas.org/foundobjects/index.cgi Latest: 19-Mar-2009


Reply With Quote
  #8  
Old   
rf
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 04:34 PM



Irina Rempt wrote:
Quote:
On Thursday 26 March 2009 20:20, Swifty wrote:

[cols and rows in textarea]

I believe it makes the box large enough to be able to display the
specified number of rows and columns even when the user types
sufficient text to cause scrollbars to appear.

I'd love to have a textarea that changed size with its containing div
on browser resize instead of staying stubbornly its [cols] width even
if that means it overlaps the sidebar.
So give it width: 100%




Reply With Quote
  #9  
Old   
dorayme
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-26-2009 , 05:07 PM



In article <1728444.hKElGaqSPk (AT) valdyas (DOT) org>,
Irina Rempt <irina (AT) valdyas (DOT) org> wrote:

Quote:
I'd love to have a textarea that changed size with its containing div on
browser resize instead of staying stubbornly its [cols] width even if that
means it overlaps the sidebar.
If you look at, say, Ed's page:

<http://edmullen.net/temp/textarea.php>

and change his line that reads like:

<textarea ... name="few" cols="5" rows="2">1111111</textarea>

to

<textarea ... style="width: 50%;" ....>1111111</textarea>

It will make for an browser width sensitive text area.

I should mention, I think Chris mentioned it to me a while back, if you
are interested as a user, "It's all text", a FF add on that allows a
nifty temporary text editor facility to pop up and you can write your
life story in there...

--
dorayme


Reply With Quote
  #10  
Old   
Irina Rempt
 
Posts: n/a

Default Re: purpose of cols / rows in textarea - 03-27-2009 , 09:59 AM






On Friday 27 March 2009 00:07, dorayme wrote:

Quote:
In article <1728444.hKElGaqSPk (AT) valdyas (DOT) org>,
Irina Rempt <irina (AT) valdyas (DOT) org> wrote:

I'd love to have a textarea that changed size with its containing div
on browser resize instead of staying stubbornly its [cols] width even
if that means it overlaps the sidebar.

If you look at, say, Ed's page:

http://edmullen.net/temp/textarea.php

and change his line that reads like:

textarea ... name="few" cols="5" rows="2">1111111</textarea

to

textarea ... style="width: 50%;" ....>1111111</textarea
Ah, right, thanks! (and rf too) Never thought of that for some reason.

Quote:
I should mention, I think Chris mentioned it to me a while back, if you
are interested as a user, "It's all text", a FF add on that allows a
nifty temporary text editor facility to pop up and you can write your
life story in there...
Don't use firefox much, only for testing (and optimising) things and to
view pages that Konqueror is too picky for, so I usually don't bother with
addons. But thanks anyway.

Irina

--
"Of course it is happening inside your head, Harry, but why on earth
should that mean that it is not real?" --Albus Dumbledore
http://www.valdyas.org/foundobjects/index.cgi Latest: 19-Mar-2009


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.