Question regarding table

M

Mathew

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
 
J

Jukka K. Korpela

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

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

Erwin Moller

Mathew wrote:

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
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top