Question regarding table

Discussion in 'HTML' started by Mathew, Jan 12, 2011.

  1. Mathew

    Mathew Guest

    All,

    I want to format the width of the columns of a table using <colgroup>.
    The following small sample

    <table border="1">
    <colgroup>
    <col width="10" />
    <col width="10" />
    <col width="10" />
    <col width="10" />
    <col width="60" />
    </colgroup>
    <tr>
    <th>
    Name
    </th>
    <th>
    Vorname
    </th>
    <th>
    Einzug
    </th>
    <th>
    Auszug
    </th>
    <th>
    Bemerkung
    </th>
    </tr>
    <tr>
    <td>
    B.
    </td>
    <td>
    Ludwig
    </td>
    <td>
    2010-12-21
    </td>
    <td>
    2011-01-03
    </td>
    <td>
    Bigger content
    </td>
    </tr>
    </table>

    works fine, but when applying this to bigger table(41 columns), changing
    of the width does not have any impact.

    Who know's what is wrong?

    Regards,

    Matthias
     
    Mathew, Jan 12, 2011
    #1
    1. Advertising

  2. Mathew wrote:

    > I want to format the width of the columns of a table using <colgroup>.


    <colgroup> as such is just for grouping, not formatting.

    > The following small sample


    .... is inferior to a URL

    > <col width="10" />


    That means 10 pixels. How much do you expect to fit there? Why are you using
    pixel dimensioning, and why do you want to set column widths at all?
    Browsers tend to do such things better.

    > <th>
    > Name
    > </th>


    You would need an extraordinarily small font size to make that fit in 10
    pixels width. Well, I would go as far as saying that it's impossible,
    provided that the text be legible at all even with super-vision.

    > <td>
    > 2010-12-21
    > </td>


    In a table with loads of columns, that notation poses a problem, because
    browsers tend to think they may split the text in two lines after a hyphen
    "-". If you really want to use the ISO 8601 notation, I'd suggest
    "protecting" it with <nobr>2010-12-21</nobr>. There are other ways to
    prevent line breaks, but this works most widely. Some people may moan over
    it because it's "nonstandard".

    > works fine, but when applying this to bigger table(41 columns),
    > changing of the width does not have any impact.


    Such a table is of questionable value on a web page or otherwise in an HTML
    document. How many people will really read and digest such data? A
    query-based approach is usually better.

    With 41 columns, you cannot avoid serious problems. But to get specific
    help, please post a specific URL.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jan 12, 2011
    #2
    1. Advertising

  3. Mathew

    Erwin Moller Guest

    On 1/12/2011 6:02 PM, Jukka K. Korpela wrote:
    > Mathew wrote:


    >> <td>
    >> 2010-12-21
    >> </td>

    >
    > In a table with loads of columns, that notation poses a problem, because
    > browsers tend to think they may split the text in two lines after a
    > hyphen "-". If you really want to use the ISO 8601 notation, I'd suggest
    > "protecting" it with <nobr>2010-12-21</nobr>. There are other ways to
    > prevent line breaks, but this works most widely. Some people may moan
    > over it because it's "nonstandard".
    >


    Hello Jukka,

    Is
    <nobr>2010-12-21</nobr>
    better supported than
    <span style="white-space:nowrap;">2010-12-21</span>
    ?

    I ask because I always use the latter these days, in strict doctype.

    Regards,
    Erwin Moller


    --
    "There are two ways of constructing a software design: One way is to
    make it so simple that there are obviously no deficiencies, and the
    other way is to make it so complicated that there are no obvious
    deficiencies. The first method is far more difficult."
    -- C.A.R. Hoare
     
    Erwin Moller, Jan 14, 2011
    #3
    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. Replies:
    2
    Views:
    589
    Duane Clark
    Jan 10, 2006
  2. David Williams
    Replies:
    2
    Views:
    1,147
    Jacob Yang [MSFT]
    Aug 12, 2003
  3. Rio
    Replies:
    4
    Views:
    1,220
  4. Laser Lips
    Replies:
    2
    Views:
    390
    Laser Lips
    Jan 30, 2009
  5. eBob.com
    Replies:
    5
    Views:
    508
    Martin Honnen
    May 20, 2008
Loading...

Share This Page