473,663 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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**********@s agitta-ps.com)
Jul 20 '05 #1
2 14149
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
2841
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 Tkinter import * class GetVariant: def __init__(self): self.root = Tk()
4
10200
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 horizontally, but also vertically, to fill the space. I took a look at their javascripts, but they are quite complex and convoluted since they make use of many of their own functions designed to work with their web site. Does anybody have a...
0
4984
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", now, when a user sees the FORM, begins to enter some data in the INPUT box, and he uses up all the 30 spaces for the INPUT box, and your business rule allows him to enter more than 30 characters including spaces (to be precise 50 in this case),...
4
11201
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
10593
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" of the word "apple", using a mouse. Is there a way to have the (usally blue) highlight expand to the character to the left and right of the original highlight, which is to say, highlight the entire word?
5
2846
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 tried setting the height and it doesn't do anything. I can set the width to some very large number like 3000px and that works ok, but it's a waste when the data doesn't require that much space. Is there a way to limit the height of the grid or of...
5
1619
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 available on encountering certain reserve words and have expand/collapse ability (just like in an IDE). any suggestions of how to do this? would it require a different "control" (i.e. not text area), specially if I wanted to add +/- signs?
1
24273
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 width will be necessary. How do I tell the dropdown (<SELECT>) and/or column (<TD>) to automatically size itself to the greater of widest item in the dropdown, and then get the smaller dropdowns to fill the width of the column? If I specify in...
7
4197
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 area, in other words, howerever the words are set, horizontally the one following the other or vertically, the one under the other. i want it to work, i tried some code but i am having problems it only work when the text entered is horizontal like...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.