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/