Why can't I change height with <col width="50" height="100">?

Discussion in 'HTML' started by Bernd Meier, Jan 13, 2008.

  1. Bernd Meier

    Bernd Meier Guest

    Why has the value of height no consequences in the below example?
    If I change width I get changes but not if I change height.

    <table border="5">
    <col width="50" height="100">
    <col width="50" height="100">
    <col width="50" height="100">
    Bernd Meier, Jan 13, 2008
    1. Advertisements

  2. Becuase there is no height attribute for the col element.

    Check with the HTML spec at http://w3.org/TR/html4/ and the Markup Validator
    at http://validator.w3.org/
    David Dorward, Jan 13, 2008
    1. Advertisements

  3. Bernd Meier

    Bernd Meier Guest

    Why has the value of height no consequences in the below example?
    Is there another element for col to change the height?

    Or is there no possibility to do it because auf logical reseans?

    Because if I would change the cell hights in one column I also have to
    the cell hights of the next columns?
    Bernd Meier, Jan 13, 2008
  4. Bernd Meier

    John Hosking Guest

    Because you're making things up.

    Prefatory remark 1: Providing a URL is better than posting code, because
    1) the URL is usually shorter,
    2) the URL lets us see, for example, what doctype you're using, and
    3) we can immediately try out your code in our browsers, without
    copy-and-paste or guessing from just looking at your code.

    Prefatory remark 2: Below I mention the recommmendation for HTML 4.01
    because I don't know what you think you're using. No URL, you see.

    Take a look at the W3C's description of the <col> element at
    There is no height attribute for <col>. You've just made it up.

    You'd have to specify the width directly to the TDs (and hope for the
    best), although in practice you can usually specify width for <TD>
    elements in one row, and all the columns in the rest of the table make
    similar use of those widths (depending on the actual content, as always).
    John Hosking, Jan 13, 2008
  5. Scripsit Bernd Meier:
    One might say so. Why would you set the height of columns instead of
    simply setting the height of the table?
    Pardon? Did you expect to change the height of each _cell_ in the

    The practical way to make the cells in a column have the same width is
    to use a class="..." attribute for the cell elements and to set the
    height of the cells in a style sheet.
    Jukka K. Korpela, Jan 13, 2008
  6. Gazing into my crystal ball I observed "Bernd Meier" <ndkwinklask263
    @yahoo.de> writing in
    Because tables are for tabular data, there really is no reason for a
    height attribute - rows expand/shrink to fit their contents, as it
    should be. Authors got into the bad habit of using tables for
    positioning content - but that is not what tables are for. HTML should
    not be presentational - that's what CSS is for.

    Unless you have a _very_ good reason for setting height, let the table
    do what it supposed to do.
    Adrienne Boswell, Jan 13, 2008
  7. Bernd Meier

    GTalbot Guest

    No doctype declaration. You will trigger modern browsers into quirks
    mode, not standards compliant rendering mode.

    Using Web Standards in your Web Pages: Making your page using web
    standards - how to

    As others told you, there is no height attribute for <col>. And the
    styling the <col> in Internet Explorer 6 and in Internet Explorer 7 is
    rather unreliable, prone to layout bugs.



    Looking for a constrained height on a table is most likely misusing
    tables to begin with. Adrienne B. gave you an excellent answer,
    exactly the kind of answer I would have given you.

    If you want help with your webpage design, then start with providing
    us with an url and a short, descriptive, meaningful explanation of
    what you are truly trying to achieve, with natural words, not with
    code explanations. Maybe you want/need a navigational horizontal list
    of 3 links... we don't know..


    Table-based webpage design versus CSS-based webpage design: resources,
    explanations and tutorials

    CSS webpage templates

    CSS webpage templates

    CSS webpage templates

    KazGarden (CSS webpage templates)


    GTalbot, Jan 14, 2008
    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.