473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting textarea box to expand horizontally to fill TD

I have a form containing a table whose cells include prompt
text strings and input areas, one of which is a textarea.

These are specified using only percent values, and I use
some simple javascript to expand the table to the available
window width. So whether the screen is maximized or partially
minimized, the table fits snugly in the available display.

The trouble is if I include a 'cols=' spec for the textarea box
its width stays fixed regardless of the actual window width,
which messes up my table width, and if I don't use a 'cols='
spec then the textarea decides to use a ridiculously small
value and the text ends up looking like that mouse tail poem
in Alice in Wonderland!

So is there a simple way, in HTML (preferably) or JavaScript,
to indicate that a textarea box should be rendered expanded
horizontally to fit the entire table cell?
Cheers

John Ramsden (jo**********@sagitta-ps.com)
Jul 20 '05 #1
2 14122
John Ramsden schrieb:
So is there a simple way, in HTML (preferably) or JavaScript,
to indicate that a textarea box should be rendered expanded
horizontally to fit the entire table cell?


No, there's no attribute you could stick in a textarea for that purpose.
But you could try a stylesheet, something like this:

textarea {width:100%;}

Browser support may vary, as usual.
Matthias
Jul 20 '05 #2
John Ramsden wrote:
So is there a simple way, in HTML (preferably) or JavaScript,
to indicate that a textarea box should be rendered expanded
horizontally to fit the entire table cell?


Sure. In your stylesheet, add:

textarea {
width: 90%;
}

....you *are* using stylesheets for layout, right?
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
4
by: David | last post by:
It's sad to say, but when using the AOL web site, like to send an email, they have a nifty capability such that when a window is resized, the textarea where the message is input expands not only...
0
by: Doug Baroter | last post by:
Hi, Here's the problem I want to solve. Suppose you design an HTML FORM with three elements of INPUT, TEXTAREA AND SUBMIT, you specify the length for the INPUT box as Size="30" and MaxLen="50",...
4
by: Steve | last post by:
Hi, I'm opening a small window with window.open. I have a textarea there, and I want it to expand to fit the window as it's resized. How is this possible? Thanks, Steve
5
by: aqualizard | last post by:
I have searched and searched and searched... Can someone please tell me how (or "if" it is even possible) to change selected text in a textarea? Specifically, say a user has highlighted "ppl"...
5
by: shanti.miller | last post by:
I've got a grid that uses paging and displays a maximum of 10 records at a time. Sometimes the fields have a lot of data in them and the datagrid takes up way too much horizontal space. I've...
5
by: sdragolov | last post by:
I would like to achieve an effect similar to the code outlining in vs.net (where you can expand and collapse sections of code) inside of a textarea in a web form. the code outlining would be...
1
by: RichardR | last post by:
I have a webpage which has a table that contains a column with several drop down boxes (<SELECT>). The contents of the drop down boxes are dynamically populated so I have no idea what the actually...
7
by: Totti | last post by:
Hi all, I am a newbie to javascript learning it for 2 months now, i am trying to make a sorter who will read english words from the one tex area or data file and show the result in the 2nd text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.