Question
My problem is that I do not want a specific TWiki table to wrap the cells.
As I understand the
PatternSkin tries to fit the table into the width of the window and wrapping is "on" by default.
However for this particular table it just makes no sense. I would rather like it to simply expand to the right as much as it needs for the cells not to wrap.
In HTML terms I want to accomplish something like the following:
<table>
<tr>
<td nowrap>this is a very very long text that we do not want the browser to wrap in any way.</td>
<td nowrap>this is a very very long text that we do not want the browser to wrap in any way.</td>
<td nowrap>this is a very very long text that we do not want the browser to wrap in any way.</td>
</tr>
</table>
which would result in
| this is a very very long text that we do not want the browser to wrap in any way. |
this is a very very long text that we do not want the browser to wrap in any way. |
this is a very very long text that we do not want the browser to wrap in any way. |
I've tried the options that
do exist on the
Plugins.TablePlugin. There is a
columnwidths option which I can't make work. Consider the following:
%TABLE{columnwidths="900,900,900"}%
|this is a very very long text that we do not want the browser to wrap in any way|this is a very very long text that we do not want the browser to wrap in any way|this is a very very long text that we do not want the browser to wrap in any way|
but what it will give me is this:
| this is a very very long text that we do not want the browser to wrap in any way |
this is a very very long text that we do not want the browser to wrap in any way |
this is a very very long text that we do not want the browser to wrap in any way |
i.e. the option seems to have no effect. In any case the
columnwidths option (if I could make it work) is not really pleasant as I would fix the size of each column possible using a lot more space than required.
Is there anyway to accomplish a table that does not wrap its content?
thx.
Environment
--
LarsBruunxHansen - 23 Aug 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
If you use HTML I recommend to use proper XHTML, e.g.
<td nowrap="nowrap">...<td>. Better yet, use css, such as
<td style="white-space: nowrap">...<td>.
You can do that also in TWiki tables:
| This is long and has no css, this is long and has no css, this is long and has no css |
This is long and has "white-space: nowrap" css, this is long and has "white-space: nowrap" css |
(look at the raw text to see how this works.)
--
PeterThoeny - 27 Aug 2007
Thanks Peter, I certainly recognise that this fixes the problem. However adding
<span style="white-space: nowrap"> ...text...</span>
to each and every cell in a table (in my case) will make the table text in raw form look really, really hard to read, and not visible in WYSIWYG mode. Adding this tweak means that from then on I'll be the only one in my organisation who can edit the table, which kind of defeats the whole Wiki idea.
I've added this functionality as a Change Request:
NoWrapInTableCells.
where I propose that the
columnwidths attribute on the
TablePlugin can also accept a value of "nowrap" in addition to explicit numerical values.
--
LarsBruunxHansen - 27 Aug 2007