|
|
Roger Wright wrote:
Use COLSPAN instead.
Doesnt work either....
Thanx
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Give us an example of your code.
Paul
|
|
|
|
|
OK
I have tried the COLSPAN in the TD , and width in TD.
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
You only have one TD in a TR? Is that common all the way down?
Did I read your question right the first time around? Was you saying that the textarea must fill the TD? In which case I return to my original answer: style="width: 100%" .
We were thinking you said that it must fill the width of the TABLE, so you needed to use colspan to make the TD several columns wide.
Paul
|
|
|
|
|
Paul Riley wrote:
style="width: 100%".
Ahhh thanx, learnt something new there It works now, just had to add to my CSS class.
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
How are you using it? A TEXTAREA tag must have a /TEXTAREA closing tag, and is valid only within a form. Put a form inside a TD element, with a TEXTAREA inside the form, and apply the COLSPAN attribute to the TD.
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Like this? Same problem TEXTAREA is fixed.
???
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
I copied this code exactly into a new html document and it worked perfectly. Within the TEXTAREA tagset the COLS attribute controls how many horizontal character spaces are dislayed; initially I saw about 80% width, so I then changed it to display COLS="120". This expanded the display area to the full screen width. The size of a TEXTAREA is measured in characters and rows of characters; I know of no way to make it variable. The COLSPAN attribute works only to allow it to spread across multiple columns of a table - your example is a one column table, so it wouldn't have any effect.
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Roger Wright wrote:
I know of no way to make it variable
Using style="width:100%;" works
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Roger Wright wrote:
A TEXTAREA tag must have a /TEXTAREA closing tag, and is valid only within a form.
OK I assume for the text to be sent to the server it must be in a FORM tag. Then I add this, BUT the FORM tag creates these extra padding inside the table as if was adding another row/line. Is there a way make this go away?
OK I have solved Just added the FORM tags around the TD tags... is that oK?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
I'm still experimenting myself... I figure whatever works is good enough. Elegant solutions can wait until I'm an expert
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Woops. I read your question completely wrong. Go with Roger's answer
Paul
|
|
|
|
|
leppie wrote:
I have a TextArea in a TABLE, but I want it t occupy the width of the table. How can this be done? COLS property is not handy at all!
Use CSS like so:
<table style="width:400px; height: 400px;">
<tr>
<td>Description</td>
<td style="width: 200px;"><textarea id="txtDescription style="width: 100%; height: 100%"></textarea></td>
</tr>
</table>
In that example you are "telling" the textarea element to fill it's containing elements available space by using the 100% attribute value.
CSS rocks people, use it
|
|
|
|
|
Paul Watson wrote:
CSS rocks people, use it
I use where I can It does get confusing sometimes though
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
I was under the impression that CSS has serious limitations with uniform behavior over a variety of browsers, so I've been sticking to what I can do with the basics. Is that not the case anymore?
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Roger Wright wrote:
I was under the impression that CSS has serious limitations with uniform behavior over a variety of browsers, so I've been sticking to what I can do with the basics. Is that not the case anymore?
It's less true since NS6 came out but it can still be a pain. I guess it depends if you want to be able to appeal to the 5%-or-so of people who refuse to use IE
Paul
|
|
|
|
|
Roger Wright wrote:
I was under the impression that CSS has serious limitations with uniform behavior over a variety of browsers, so I've been sticking to what I can do with the basics. Is that not the case anymore?
Yes and no.
This is tough to explain without you spending a good amount of time learning CSS.
Ok, if you HAVE to "support" Netscape 4.x then CSS is going to give you a lot of trouble. N4 does not have enough CSS support and also does CSS wrong i.e. it implemented the standard incorrectly.
If you have to support IE4 then you will still need to use TABLEs for layout but at least you can use a good deal of CSS formatting which is better than not using it.
If you need to support IE5.x then things are looking up. There are a few issues but they can be worked around.
If you need to only support IE6 and Netscape 6 then you are two steps away from heaven. They do a great job of supporting CSS.
Considering that Netscape 4.x has a miniscule portion of the market and so does IE4 you really can be using CSS right now. Obviously there are different levels in CSS, mainly two: Formatting and layout/positioning. Formatting is fine and IE4 and up supports it well enough. Layout though is only really doable in IE5 and up (including Netscape 6, Mozilla 1.0, Opera 6.0 etc.)
But all of this is a mute point. We should not be coding towards specific browsers. We should be implementing the standards and ensuring that what we do code is accesible to every agent and device (from PC to cell phone to PDA to text readers for the blind.) So what if it is a few pixels out on one browser, so long as the visitor can a: navigate, b: read your content and c: buy your goods then we are doing the right thing. The web is about access to information to all. Actually using TABLE layouts, FONT tags etc. is counter to this prime directive.
Bottom line for me is: CSS makes maintaining and changing a site an absolute bliss. You just change one central file to re-layout and re-format your site. Try that with the old way
Anyway from all the CSS talk lately I think an article is in need. But before that read AListApart.com for some damned good info on real world CSS, HTML etc.
|
|
|
|
|
Good points, Paul. Thanks for the info, and I quite agree with the philosophy of coding to the standard. A comprehensive article would be most welcome!
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Hi all (and Paul, you seem to be the one replying )
I discovered the beauty of the "display:none" property. Now this works like a dream to show/hide my table details
Now on client side, i want to some extra HTML below each table that can be shown on or off, but inserting the "same" HTML below each table (maybe as much as 50) seems to me like a HUGE bandwidth buster!
Now is there a way I can insert the code at client-side via JavaScript only when it needs to be shown? I see JavaScript has a method to output HTML, but how does one do this?
Cheers, any help appreciated
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
leppie wrote:
Hi all (and Paul, you seem to be the one replying )
Hi leppie
That's what I like about you; a new challenge every day
Is there any reason you can't have a variable containing the text you want, an empty DIV under each table and then use javascript to set the text in the DIV at the same time as making it visible?
I would tend to avoid going back to the server for it if humanly possible.
Paul
|
|
|
|
|
Paul Riley wrote:
That's what I like about you; a new challenge every day
Need to move fast!
Paul Riley wrote:
Is there any reason you can't have a variable containing the text you want, an empty DIV under each table and then use javascript to set the text in the DIV at the same time as making it visible?
Erm, wasnt that MY question? How do I do that? I have 2 days JavaScript experience, although modifying code is no problem, creating it from scratch is
Paul Riley wrote:
I would tend to avoid going back to the server for it if humanly possible.
Especially if you consider the page size is mostly very big already
Thanx
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
leppie wrote:
Erm, wasnt that MY question? How do I do that?
Wasn't sure that was your question, now that I know it is... I think it's divName.innerHTML = "<b>This is my text</b>";
It's been a long time since I've done anything like this but I'm fairly sure it's something like that.
Paul
|
|
|
|
|
OK before I attempt it, a few questions, OK? MMkay!
1. I mark each area with a DIV tag and give an ID.
2. I make a function that inserts code into the DIV (like you have above)
3. I call the function from an onclick passing the DIV tag ID as param.
Does that sound correct?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Yeah, sounds about right. If you're passing that as a parameter, you probably need to use document.formName.elements[divName].innerHTML or something like that.
(If you get into trouble, I'll actually bother to get the DHTML book out instead of continuing to try this from memory )
P
Paul
|
|
|
|