Question
Hi, Can anyone explain why using verbatim or pre tags within a TWiki table results in following:
| <verbatim>zzzzzzzzzzzzzzzzzzz zzzzzzzzzzz zzzzzzz z z zzzzzzzzzzzz z zzzzzzzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z zzzzzzzzzzz zzzzz zzzz zzzz zzzzzzz zzzzzzz z z zzzzzzzz zzzz z zzzz zzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z z</verbatim> |
zzzzzzzzzzzzzzzzzzz zzzzzzzzzzz zzzzzzz z z zzzzzzzzzzzz z zzzzzzzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z zzzzzzzzzzz zzzzz zzzz zzzz zzzzzzz zzzzzzz z z zzzzzzzz zzzz z zzzz zzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z z |
In example above, I first put the source table within verbatim tags to illustrate syntax I used. It scrolls fine - scroll bar is just as wide as the page. In second, I used the verbatim tag within a table as I would like to use it and no scroll bar is rendered, text is carried ff the page. On my site this is rendered a little different in IE:
In FF, is yet again different - no scroll bar at all in verbatim text, text is carried off of page.
Any way to force verbatim text to fit within a table cell? I have already tried to use tablewidth attribute and a div with width defined. Neither have changed the appearance.
Thanks.
Environment
--
MichelleAlbertin - 26 Nov 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.
Rendering
pre text inside table celss is a problem for most browsers.
You can try with the CSS style
table {table-layout: fixed;}, but you cannot use that for all tables. If set in a site-wide style sheet it would mess up tables in other topics.
Example:
%TABLE{id="test"}%
| <verbatim>zzzzzzzzzzzzzzzzzzz zzzzzzzzzzz zzzzzzz z z zzzzzzzzzzzz z zzzzzzzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z zzzzzzzzzzz zzzzz zzzz zzzz zzzzzzz zzzzzzz z z zzzzzzzz zzzz z zzzz zzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z z</verbatim> |
<style>
table#test {table-layout: fixed;}
</style>
Renders as:
zzzzzzzzzzzzzzzzzzz zzzzzzzzzzz zzzzzzz z z zzzzzzzzzzzz z zzzzzzzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z zzzzzzzzzzz zzzzz zzzz zzzz zzzzzzz zzzzzzz z z zzzzzzzz zzzz z zzzz zzzzzzzzzz zzz zzz zzz zzz zzz z z z z z z zzzzz z zz z z z z |
--
ArthurClemens - 26 Nov 2007
Thanks Arthur, that did the trick in IE6 though in FF there is still no scroll bar at all (on my TWiki) and my left and top bars have disappeared (the text, not the bars themselves). Odd. This forum topic however renders the same in IE6 and FF.
--
MichelleAlbertin - 26 Nov 2007
Odd. TablePlugin creates a table with id
tabletest when I write
id="test". That looks like a bug. In the meantime try to use
tabletest in your stylesheet.
--
ArthurClemens - 26 Nov 2007