![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
white-space:nowrap; |
#3
| |||
| |||
|
|
white-space:nowrap; this keeps the text from wraping so if your text is longer then the width it will overflow. ie. increase the containers width. white-space:normal; is adviced Yes, that is intended: I want these rows fixed in height. |
#4
| |||
| |||
|
|
Jean Pion: text-overflow:ellipsis; Do you really expect proposed CSS3 properties to work? |
|
table class="tbl" tr td width="150px">Spacer 1</td td width="50px">S4L</td td width="*">(...) hopefully truncate correctly. </td td width="150px">Spacer 2 </td /tr /table Those attribute values are invalid, although a DTD validator won't find the errors (a linter should). Anyhow, it looks like you actually want table.tbl {margin: 0 150px}. table class="tbl"><tr><th>S4L<td>(long sentence)</table (Consider using '%' or 'em' instead of 'px'.) |
|
Though this works fine, but I would like to set the column width in the css. Columns are marked up in HTML by 'col' elements by the way. table.tbl td.col1 { width: 150px; color: blue; } td class="col1">Spacer 1</td This makes my text blue Sure (for 'col' elements this would only work in browsers without support for CSS tables and with incorrect inheritance, namely IE). but does not set my width... Yes, it does, but under some circumstances might be ignored anyhow. It's often wise not to set too many widths explicitly. Note that in the fixed table layout algorithm only the columns or cells of the first row should set the width. |
![]() |
| Thread Tools | |
| Display Modes | |
| |