issue with textarea and rowspan

G

graphicsxp

Hi,

I can't get my textarea to fill in the TD it belongs to. Consider the
following :

<table>
<tr>
<td rowspan="3" style="width:50%">
<textarea id="txtComments" style="height: 100%; width:100%"
tabindex="6"></textarea>
</td>
<td style="text-align:right;"><span
class="itemLabel">Journalist</span></td>
</td>
</tr>
<tr>
<td style="text-align:right;">
<span class="itemLabel">Readership</span>
</td>
<td>
<input id="txtReadership" value="0" tabindex="5"/>
</td>
</tr>
<tr>

<td style="text-align:right;">
<span class="itemLabel">Ave</span>
</td>
<td>
<input id="txtAVE" value="0" tabindex="4"/>
</td>
</tr>
</table>


As you can see the first td should span across 3 rows and it does, but
the textarea doesn't !

Can you help ?
 
A

Adrienne Boswell

Hi,

I can't get my textarea to fill in the TD it belongs to. Consider the
following :

A URL would be much better. Having said that, your markup is a
maintenance nightmare, for several reasons.

1. Inline styles mean that if you want to change something later, you
have to go into each page with that style and change it. This is the
reason for using an external style sheet, so that one change to the
stylesheet changes the entire application.

2. Prefixing an id name with its type is also a nightmare, especially
server side, when you want to put form contents into a db. You have to
tell the script that txtComments is a the db field comments. You would
be a lot better off just naming the form fields that same name as the db
fields. You can do a lot more programatically, and reuse code, which
will save a lot of time and maintenance headaches in the future.

3. Abuse of tables. There are some that say that a form qualifies as
tabular data. However, you would be better served using the label
element and styling it accordingly.

<snip>
 
G

graphicsxp

A URL would be much better.  Having said that, your markup is a
maintenance nightmare, for several reasons.

1. Inline styles mean that if you want to change something later, you
have to go into each page with that style and change it.  This is the
reason for using an external style sheet, so that one change to the
stylesheet changes the entire application.

2. Prefixing an id name with its type is also a nightmare, especially
server side, when you want to put form contents into a db.  You have to
tell the script that txtComments is a the db field comments.  You would
be a lot better off just naming the form fields that same name as the db
fields.  You can do a lot more programatically, and reuse code, which
will save a lot of time and maintenance headaches in the future.

3. Abuse of tables.  There are some that say that a form qualifies as
tabular data.  However, you would be better served using the label
element and styling it accordingly.

<snip>

Hi,
Thanks for the reply but you are not really answering my question.
Regarding the inline style, they are only for the example and I do use
stylesheets.
If you copy/paste the code I gave you will see the issue I'm talking
about. The textarea is not filling up the TD, whatever the browser is.
Is there a reason for that ?
 
A

Adrienne Boswell

If you copy/paste the code I gave you will see the issue I'm talking
about. The textarea is not filling up the TD, whatever the browser is.
Is there a reason for that ?

You really need to supply a URL. I am not going to open my editor, and
copy and paste your markup, especially when I do not have other markup that
you did not post here that may have an effect on your issue. Doctype,
external, and/or style level CSS may all have an effect that I would not be
able to verify without the actual markup.

If this is something that is for an intranet, then I suggest you post the
page somewhere on the Internet. There are plenty of free hosting services
available if your ISP does not provide one.
 
J

Jonathan N. Little

Hi,
Thanks for the reply but you are not really answering my question.
Regarding the inline style, they are only for the example and I do use
stylesheets.
If you copy/paste the code I gave you will see the issue I'm talking
about. The textarea is not filling up the TD, whatever the browser is.
Is there a reason for that ?

In addition to all the *valid* points that Adrienne raised, for
TEXTAREAs the "rows" and "cols" attributes are *not* optional.

http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA

Next a TEXTAREA is typically sized to fit a particular number of rows
and columns of content text, not visual dimensions.

In you snippet we cannot tell if your are triggering quirks mode that
would definitely relate to how CSS rules a applied for different browser.

And lastly, "width: 100%" and "height: 100%" only works when the
containing block element has explicit dimensions...
 
G

graphicsxp

In addition to all the *valid* points that Adrienne raised, for
TEXTAREAs the "rows" and "cols" attributes are *not* optional.

http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA

Next a TEXTAREA is typically sized to fit a particular number of rows
and columns of content text, not visual dimensions.

In you snippet we cannot tell if your are triggering quirks mode that
would definitely relate to how CSS rules a applied for different browser.

And lastly, "width: 100%" and "height: 100%" only works when the
containing block element has explicit dimensions...

Hi Jonathan,
Thanks for the reply, that helps. The cols and rows parameter are
indeed making a difference. Apparently the height of my textarea is
changed according to the value of cols. That also makes its td
growing. However that is the opposite effect that I want. I'd like the
textarea to fit the td !
Is there a way of doing so ? if not I may have to use javascript.
 
J

Jonathan N. Little

Hi Jonathan,
Thanks for the reply, that helps. The cols and rows parameter are
indeed making a difference. Apparently the height of my textarea is
changed according to the value of cols.

I think you mean "rows", cols determine the number of characters *wide*
That also makes its td
growing.

The default behavior for tables! They are supposed to expand to fit
content. One of the many reasons *not* to use tables for layout.

However that is the opposite effect that I want. I'd like the
textarea to fit the td !

You must have missed my last point. Hint: what are the CSS box
dimensions of the containing TD? Also who knows what you have in the
rest of your page that may affect the layout
Is there a way of doing so ? if not I may have to use javascript.
 
D

dorayme

That also makes its td
growing.

The default behavior for tables! They are supposed to expand to fit
content. One of the many reasons *not* to use tables for layout.[/QUOTE]

No doubt you mean this in a particular way and context that makes it
true. But I point out that this is often a *particularly* good reason to
use tables for layout where you want flexibibility to suit the users
screen...
 
J

Jonathan N. Little

dorayme said:
The default behavior for tables! They are supposed to expand to fit
content. One of the many reasons *not* to use tables for layout.

No doubt you mean this in a particular way and context that makes it
true. But I point out that this is often a *particularly* good reason to
use tables for layout where you want flexibibility to suit the users
screen...
[/QUOTE]

Fine, if that is what you wish, but that is not what the OP wanted.
 
G

graphicsxp

dorayme said:
Fine, if that is what you wish, but that is not what the OP wanted.

er...yes I do use table to fit the users screen ! I never said I
didn't. Anyway this Textarea control is really annoying. Ideally there
should be no need to set its cols and rows properties and setting the
width and height to 100% should be enough. Instead I have to give a
value to the rows properties in order to control its height. And
surprise surprise... results are different in FF and IE...
 
J

Jonathan N. Little

er...yes I do use table to fit the users screen ! I never said I
didn't. Anyway this Textarea control is really annoying. Ideally there
should be no need to set its cols and rows properties and setting the
width and height to 100% should be enough.

Except that the attributes are not optional but are required for valid
HTML, CSS on the other hand is *always* optional.
Instead I have to give a
value to the rows properties in order to control its height. And
surprise surprise... results are different in FF and IE...

Depends on *how* you did it and how the *rest* of the page is. As I
stated before, if your page is triggering quirks mode then inconstancies
are almost assured!
 
D

dorayme

er...yes I do use table to fit the users screen ! I never said I
didn't. Anyway this Textarea control is really annoying. Ideally there
should be no need to set its cols and rows properties and setting the
width and height to 100% should be enough. Instead I have to give a
value to the rows properties in order to control its height. And
surprise surprise... results are different in FF and IE...

Still no URL with the mistakes mentioned by others fixed?

What have we here...

I don't much like the look of your:

<td rowspan="3" style="width:50%">

If it spans 3 rows then it spans them as they are! It looks mighty
unclear what you want the td to be 50% of in addition to the spanning.
If you are trying to order the 3 rows to be 50% of something (the
table?) from within the spanning cell, what can I tell you? Don't be so
cheeky, the spanned rows will see it as impertinent even if they
understood your directive. They will *not* be dictated to by one cell.
They are a team of three, they have probably been together for ages and
why should they take orders from something that is itself ordered to
span *them*?

Please respect these proud objects. They do the final judging, not you.
They shrink or expand to fit their contents. That is is their
gravitational field as it were, that is their final cause in the
Aristotelian sense.

Does this not do what you want? Won't it be "good enough"?

<http://netweaver.com.au/alt/thisMightDo.html>

Kind of nice in some browsers how the whole table grows as you drag the
yellow text area bigger...
 
J

Jukka K. Korpela

dorayme said:
Still no URL with the mistakes mentioned by others fixed?

That misbehavior alone, even when not counting pointless massive quoting
that indicates, as usual, lack of comprehensive reading, gives us just two
options:
- ignore him
- ignore him now and in the future, i.e. killfile him.

(And nobody seems to have mentioned abuse of <span> in a situation where
adequate markup, <label>, would give tangible benefits.)
 
D

dorayme

"Jukka K. Korpela said:
That misbehavior alone, even when not counting pointless massive quoting
that indicates, as usual, lack of comprehensive reading, gives us just two
options:
- ignore him
- ignore him now and in the future, i.e. killfile him.

(And nobody seems to have mentioned abuse of <span> in a situation where
adequate markup, <label>, would give tangible benefits.)

What a cunning plan you have hatched! It is to deprive me of my living.
Do you think I just like answering usenet posts? I am on a contract
where I get scaled fees for various jobs, I have found rich pickings in
reminding about URLs (e.g. $US2.20 per reminder - OK, its not much but
hey, it adds up) <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top