Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Question regarding table

Reply
Thread Tools

Question regarding table

 
 
Mathew
Guest
Posts: n/a
 
      01-12-2011
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
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-12-2011
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/

 
Reply With Quote
 
 
 
 
Erwin Moller
Guest
Posts: n/a
 
      01-14-2011
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE different to FF regarding image and table Laser Lips HTML 2 01-30-2009 01:35 PM
table.rows vs. table.getElementsByTagName (+ a regex question) eBob.com Javascript 5 05-20-2008 10:58 AM
regarding look up table onkarkk@gmail.com VHDL 2 01-10-2006 05:09 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57