spaces and tabs

1,009 views
Skip to first unread message

Backslash

unread,
Apr 12, 2008, 5:47:04 PM4/12/08
to TiddlyWiki
hi folks,
i insert more spaces and tabs to separate some phrases, this don't
work! i see everytihng as i digited one space. How solve?
And to change the alignement of text?

thx a lot

Mythos

unread,
Apr 12, 2008, 6:29:27 PM4/12/08
to TiddlyWiki
You can replace the spaces (if more than one) with <html>&nbsp;&nbsp;</
html> where each &nbsp; replaces a space.
Example:
One space
Two<html>&nbsp;&nbsp;</html>spaces
Three<html>&nbsp;&nbsp;&nbsp;</html>spaces
Four<html>&nbsp;&nbsp;&nbsp;&nbsp;</html>spaces

Eric Shulman

unread,
Apr 12, 2008, 6:35:18 PM4/12/08
to TiddlyWiki
> i insert more spaces and tabs to separate some phrases, this don't
> work! i see everytihng as i digited one space. How solve?

As with all browser-rendered content, the default is to reduce all
whitespace, including spaces, tabs, and newlines, to single-spaces and
then word-wrap the results.

To preserve whitespace exactly as entered, you can use TW's 'inline
CSS' syntax, like this:

@@white-space:pre;content goes here
second line
indented third line
@@

Note: the @@attribute:value;...@@ syntax cannot be nested, so any text
it surrounds cannot use the @@ syntax itself.

For greater flexibility (including nesting of CSS formats), you can
define a custom CSS class in [[StyleSheet]], like this:

.myClass { white-space:pre; }

and then use TW's "CSS class wrapper" syntax in your content, like
this:

{{myClass{content goes here
second line
indented third line
}}}

> And to change the alignment of text?

There are lots of formatting 'shortcuts' that can be achieved with CSS
class wrappers. For a convenient set of pre-defined classes, see:
http://www.TiddlyTools.com/#StyleSheetShortcuts

To use these class definitions, you can either:
A) copy/paste the desired declarations directly into your
[[StyleSheet]]
or
B) Enter:
[[StyleSheetShortcuts]]
(with the brackets) into your [[StyleSheet]] to *include* the entire
set of shortcuts without having to copy/paste the individual
declarations.

HTH,
-e

Eric Shulman

unread,
Apr 13, 2008, 6:39:22 AM4/13/08
to TiddlyWiki
> You can replace the spaces (if more than one) with <html>&nbsp;&nbsp;</
> html> where each &nbsp; replaces a space.
> Example:
> One space
> Two<html>&nbsp;&nbsp;</html>spaces
> Three<html>&nbsp;&nbsp;&nbsp;</html>spaces
> Four<html>&nbsp;&nbsp;&nbsp;&nbsp;</html>spaces

Note: TW directly supports use of HTML 'entity' syntax (e.g., &nbsp;)
without requiring surrounding <html>...</html>. Thus:

Two&nbsp;&nbsp;spaces
Three&nbsp;&nbsp;&nbsp;spaces
etc.

-e

FND

unread,
Apr 13, 2008, 6:46:01 AM4/13/08
to Tiddl...@googlegroups.com
> @@white-space:pre;content goes here
> second line
> indented third line
> @@

Did this always work? I was under the impression that this inline syntax
had to be on a single line - quite surprised that's not the case (anymore?).


-- F.

Mythos

unread,
Apr 15, 2008, 7:04:23 PM4/15/08
to TiddlyWiki
I haven't always had luck not using the <html> tags, sometimes it
works without them, sometimes it doesn't.
Reply all
Reply to author
Forward
0 new messages