Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / HTML / October 2008



Tip: Looking for answers? Try searching our database.

issue with textarea and rowspan

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
graphicsxp@googlemail.com - 30 Oct 2008 13:32 GMT
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>
        <input id="txtJournalist"  style="width:180px" tabindex="3"/

     </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 ?
Adrienne Boswell - 30 Oct 2008 14:20 GMT
Gazing into my crystal ball I observed "graphicsxp@googlemail.com"
<graphicsxp@googlemail.com> writing in news:6eafb707-e1dc-4d41-a999-
22a25dd87d9b@k13g2000hse.googlegroups.com:

> 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>

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

graphicsxp@googlemail.com - 30 Oct 2008 14:26 GMT
> Gazing into my crystal ball I observed "graphic...@googlemail.com"
> <graphic...@googlemail.com> writing in news:6eafb707-e1dc-4d41-a999-
[quoted text clipped - 30 lines]
> Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
> Please respond to the group so others can share

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 ?
Adrienne Boswell - 30 Oct 2008 14:34 GMT
Gazing into my crystal ball I observed "graphicsxp@googlemail.com"
<graphicsxp@googlemail.com> writing in news:7526291b-475a-4d5b-a2cd-
eeae7d9af65d@k13g2000hse.googlegroups.com:

> 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.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jonathan N. Little - 30 Oct 2008 14:41 GMT
> Hi,
> Thanks for the reply but you are not really answering my question.
[quoted text clipped - 3 lines]
> 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...

Signature

Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

graphicsxp@googlemail.com - 30 Oct 2008 14:54 GMT
> graphic...@googlemail.com wrote:
>
[quoted text clipped - 26 lines]
> -------------------
> LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com

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.
Jonathan N. Little - 30 Oct 2008 15:16 GMT
>> graphic...@googlemail.com wrote:
>>
[quoted text clipped - 18 lines]
>> And lastly, "width: 100%" and "height: 100%" only works when the
>> containing block element has explicit dimensions...

<snip signatures in Usenet>

> 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.

Signature

Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

dorayme - 30 Oct 2008 21:18 GMT
> > 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.

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...

Signature

dorayme

Jonathan N. Little - 30 Oct 2008 22:07 GMT
>>> That also makes its td
>>> growing.
[quoted text clipped - 5 lines]
> use tables for layout where you want flexibibility to suit the users
> screen...

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

Signature

Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

graphicsxp@googlemail.com - 30 Oct 2008 23:38 GMT
> > In article <adcd1$4909c1bb$40cba7c8$25...@NAXS.COM>,
>
[quoted text clipped - 16 lines]
> -------------------
> LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com

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...
Jonathan N. Little - 31 Oct 2008 01:43 GMT
> 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!

Signature

Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

dorayme - 31 Oct 2008 02:05 GMT
In article
<a8244ed4-b965-4296-9b3d-2ecefb43acef@x41g2000hsb.googlegroups.com>,

> > > In article <adcd1$4909c1bb$40cba7c8$25...@NAXS.COM>,
> >
[quoted text clipped - 9 lines]
> >
> > 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...

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...

Signature

dorayme

Jukka K. Korpela - 31 Oct 2008 18:14 GMT
> 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.)

Signature

Yucca, http://www.cs.tut.fi/~jkorpela/

dorayme - 31 Oct 2008 21:47 GMT
> > Still no URL with the mistakes mentioned by others fixed?
>
[quoted text clipped - 6 lines]
> (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>

Signature

dorayme

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.