Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Solaris 10
Web server: Apache 2
Perl version:  
Client OS:  
Web Browser: Internet Explorer v6
Categories: Plugins

-- LarsBruunxHansen - 23 Aug 2007

Answer

ALERT! 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

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2007-08-27 - LarsBruunxHansen
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.