[pmwiki-users] preformatted text fixed width

DaveG pmwiki at solidgone.com
Tue Jan 20 07:43:22 CST 2009

wikitext is added by PmWiki during page generation. It's the main 
container for the wiki page. Simply add this to the css file:
    width: 600px;

Maria McKinley wrote:
> On Sun, Jan 18, 2009 at 8:57 AM, DaveG <pmwiki at solidgone.com> wrote:
>> The main issue is that code tags are defined as:
>> code.escaped {
>>  white-space:nowrap;
>> }
>> What this means is that the line will be as long as necessary to fit the
>> entire text, without wrapping. The side effect of this is that now the
>> entire .rightColumn is the same width as the 'code', so even setting lesser
>> widths on other elements won't change the rightColumn width.
>> Normally the solution is to add "overflow: auto", to add a scrollbar to the
>> non-wrapped lines. In this case that doesn't work, and I didn't have time to
>> work out why. (Strangely adding "overflow: auto; white-space: nowrap" to
>> .vspace does force the scrollbar -- although it has the significant unwanted
>> effect of putting a scrollbar on every .vspace paragraph :) ) I *suspect*
>> this has something to do with using tables -- but I have no evidence for
>> that other than inexperience with tables.
>> pre tags seem to work fine, so one thing you might try is defining code to
>> be the same as pre, on line 137 of rounded.css:
>>   pre, code {
>> btw, adding a width to wikitext rather than rightColumn forces the
>> rightColumn width.
>> Summary: Add a width to .wikitext, and make code the same as pre.
>>  ~ ~ Dave
> Thanks Dave. I see what you mean now about there being a long line of
> code that is forcing all of the code blocks to be a certain size, and
> how it would be ideal if there were just a scrollbar for that line. I
> guess then the rest would just be as big as they needed to be for that
> particular block, or more probably go to the wraparound point.
> Unfortunately, your solution did not fix this for me. Actually, I only
> tried it partway. I added code to pre, but I had to use rightColumn
> for the width, because I did not see a .wikitext. But doing these two
> things seemed to have no affect. Is .wikitext being missing maybe part
> of the problem? I am using the most recent rounded, so not sure why
> this would be, unless .wikitext is suppose to be somewhere besides
> rounded.css.
> thanks,
> maria

More information about the pmwiki-users mailing list