issue with textarea and rowspan

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

  1. graphicsxp

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

  2. 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, Oct 30, 2008
    #2
    1. Advertisements

  3. graphicsxp

    graphicsxp Guest

    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 ?
     
    graphicsxp, Oct 30, 2008
    #3
  4. 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, Oct 30, 2008
    #4
  5. 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...
     
    Jonathan N. Little, Oct 30, 2008
    #5
  6. graphicsxp

    graphicsxp Guest

    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.
     
    graphicsxp, Oct 30, 2008
    #6
  7. I think you mean "rows", cols determine the number of characters *wide*
    The default behavior for tables! They are supposed to expand to fit
    content. One of the many reasons *not* to use tables for layout.

    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
     
    Jonathan N. Little, Oct 30, 2008
    #7
  8. graphicsxp

    dorayme Guest

    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...
     
    dorayme, Oct 30, 2008
    #8
  9. 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.
     
    Jonathan N. Little, Oct 30, 2008
    #9
  10. graphicsxp

    graphicsxp Guest

     
    graphicsxp, Oct 30, 2008
    #10
  11. Except that the attributes are not optional but are required for valid
    HTML, CSS on the other hand is *always* optional.
    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!
     
    Jonathan N. Little, Oct 31, 2008
    #11
  12. graphicsxp

    dorayme Guest

     
    dorayme, Oct 31, 2008
    #12
  13. 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.)
     
    Jukka K. Korpela, Oct 31, 2008
    #13
  14. graphicsxp

    dorayme Guest

    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, Oct 31, 2008
    #14
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.