issue with textarea and rowspan

Discussion in 'HTML' started by graphicsxp@googlemail.com, Oct 30, 2008.

  1. Guest

    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 ?
    , Oct 30, 2008
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed ""
    <> writing in news:6eafb707-e1dc-4d41-a999-
    :

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


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Oct 30, 2008
    #2
    1. Advertising

  3. Guest

    On 30 oct, 13:20, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed ""
    > <> writing in news:6eafb707-e1dc-4d41-a999-
    > :
    >
    > > 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>
    >
    > --
    > Adrienne Boswell at Home
    > 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 ?
    , Oct 30, 2008
    #3
  4. Gazing into my crystal ball I observed ""
    <> writing in news:7526291b-475a-4d5b-a2cd-
    :

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

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Oct 30, 2008
    #4
  5. wrote:

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

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 30, 2008
    #5
  6. Guest

    On 30 oct, 13:41, "Jonathan N. Little" <> wrote:
    > wrote:
    >
    > > 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...
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > 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.
    , Oct 30, 2008
    #6
  7. wrote:
    > On 30 oct, 13:41, "Jonathan N. Little" <> wrote:
    >> wrote:
    >>
    >>> 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...
    >>


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



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 30, 2008
    #7
  8. dorayme Guest

    In article <adcd1$4909c1bb$40cba7c8$>,
    "Jonathan N. Little" <> wrote:

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

    --
    dorayme
    dorayme, Oct 30, 2008
    #8
  9. dorayme wrote:
    > In article <adcd1$4909c1bb$40cba7c8$>,
    > "Jonathan N. Little" <> wrote:
    >
    >>> 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...
    >


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

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 30, 2008
    #9
  10. Guest

    On 30 Oct, 21:07, "Jonathan N. Little" <> wrote:
    > dorayme wrote:
    > > In article <adcd1$4909c1bb$40cba7c8$>,
    > >  "Jonathan N. Little" <> wrote:

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

    >
    > Fine, if that is what you wish, but that is not what the OP wanted.
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > 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...
    , Oct 30, 2008
    #10

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

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 31, 2008
    #11
  12. dorayme Guest

    In article
    <>,
    "" <> wrote:

    > On 30 Oct, 21:07, "Jonathan N. Little" <> wrote:
    > > dorayme wrote:
    > > > In article <adcd1$4909c1bb$40cba7c8$>,
    > > >  "Jonathan N. Little" <> wrote:

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

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

    --
    dorayme
    dorayme, Oct 31, 2008
    #12
  13. dorayme wrote:

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

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Oct 31, 2008
    #13
  14. dorayme Guest

    In article <Q2HOk.87071$>,
    "Jukka K. Korpela" <> wrote:

    > dorayme wrote:
    >
    > > 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.)


    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>

    --
    dorayme
    dorayme, Oct 31, 2008
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W...1

    colspan and rowspan problems

    Bruce W...1, Oct 22, 2003, in forum: HTML
    Replies:
    2
    Views:
    3,284
    Jerry Perkins
    Oct 22, 2003
  2. Klaus Wertler

    Colspan and rowspan

    Klaus Wertler, Nov 25, 2003, in forum: HTML
    Replies:
    8
    Views:
    1,437
    Sid Ismail
    Nov 27, 2003
  3. William
    Replies:
    8
    Views:
    470
    Jonathan N. Little
    Jan 14, 2007
  4. Augustus
    Replies:
    1
    Views:
    340
    Ken Schaefer
    Sep 10, 2003
  5. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    318
    Anthony Jones
    Feb 5, 2006
Loading...

Share This Page