LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2006, 12:21 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
Textarea "cols" and screen width


Is there a way to make a textarea take a certain portion of the screen?
For example I'd like 2 textarea take each 50% of the screen width.
Is this possible and how?
 
Old 01-14-2006, 08:38 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Off the top of my head all I can think of is to put two textareas in either two columns of a single row table or two divs placed next to each other. Then set the cols to a suitably large number. I believe that it is then up to the browser to decide how it renders the text area.

graeme
 
Old 01-14-2006, 11:19 PM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you for your answer graemef.
Both methods still try to accommodate the width defined in the textarea by adding a horizontal scroll bar.

Is there a simple solution in PHP?
 
Old 01-15-2006, 07:45 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
PHP can only generate HTML code not determine how it is rendered in the browser. Because the browser window can be of different, widths, font displays etc it is not possible to control this, however I thought that most browsers now will wrap the text and only put a scroll bar in if required.

graeme.
 
Old 01-15-2006, 09:19 AM   #5
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Using tables definitely puts in a horizontal scroll bar in 2 adjacent textareas if the "cols" take more than the screen width, I am now getting a different result using <div></div> comprising 2 textareas which are put on top of one another when the combined "cols" exceed the width of the screen, they are correctly adjacent when "cols" is smaller.

I have to say I've got an unstable system (waiting for a new motherboard) that has been doing very strange things, this may be one of them if you think the browser should render this correctly.
 
Old 01-15-2006, 10:15 AM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Well unfortunately browsers tend to do their own thing. I also tend to use divs more than tables because of their greater flexibility. So maybe it would be best to stick with the divs but be aware that the rendering on some browsers may not be as nice as you would like.

all the best,

graeme.
 
  


Reply



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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Core 2: Screen Resolution can not change from "800X600" to "1024X 768" suhaimi_sj Fedora - Installation 18 12-17-2009 03:29 AM
Screen not off in "Suspend" or "StandBy" Riddick Linux - Laptop and Netbook 8 09-22-2005 04:50 AM
Undefined Screen " XFree86" reference by serverLayout "XFree86 Configured" comox *BSD 7 01-17-2005 05:47 PM
MDK 9.2: X freezes with a black screen or blue screen with "X cursor" Apoc Linux - Newbie 10 03-30-2004 03:38 PM
MDK 9.2: X freezes on a black screen or blue screen with "X cursor" Apoc Linux - Software 1 12-29-2003 03:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration