468,532 Members | 1,708 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,532 developers. It's quick & easy.

<col> and <colgroup> with classes

Me again!

This time I'd like to prevent an entire column of a table to have no
word-wrapping. So I defined this class in the style sheet:

..nobr {
white-space: nowrap;
}

When I define table cells like this: <td class="nobr"> everything works
fine. But using this class for an entire column doesn't work (I don't
want the "16:00 - 18:00" part wrapped):

<table cellspacing="0" cellpadding="10" border="1">
<colgroup>
<col>
<col class="nobr">
</colgroup>
<tbody>
<tr>
<td>Montag</td>
<td>16:00 - 18:00</td>
<td> ... </td>
</tr>
</tbody>
</table>
What am I doing wrong;

--
"With me is nothing wrong! And with you?" (from r.a.m.p)
Jul 20 '05 #1
1 9118


Daniel Haude wrote:
This time I'd like to prevent an entire column of a table to have no
word-wrapping. So I defined this class in the style sheet:

.nobr {
white-space: nowrap;
}

When I define table cells like this: <td class="nobr"> everything works
fine. But using this class for an entire column doesn't work (I don't
want the "16:00 - 18:00" part wrapped):

<table cellspacing="0" cellpadding="10" border="1">
<colgroup>
<col>
<col class="nobr">
</colgroup>
<tbody>
<tr>
<td>Montag</td>
<td>16:00 - 18:00</td>
<td> ... </td>
</tr>
</tbody>
</table>
What am I doing wrong;


Probably overestimating the power of the <col> element, check what the
CSS 2 specification has to say about column elements at
http://www.w3.org/TR/CSS2/tables.html#q4
and it only lists the CSS properties
border, background, width, visibility
as those that can be applied to columns to influence table cells.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.