Also, could someone tell me how to make the text in each cell be
"top-justified" instead of being vertically centered?
.viewer tr {
vertical-align: top
}I need to have multiple lines within a cell in a table. I have
searched this group, and I am aware of the partTiddler plugin as well
as the notion of using <<tiddler>> macro inside a cell to get the
effect. Having the content sit somewhere else will not suit my needs
at all because the text is usually short and very localised, and there
will be lots of occurrences like this -- I don't want to come up with a
"partname" (or worse, a tiddler name) everytime this happens.
Ideally what I want is something that looks like this (and visually you
can guess what the final table look like):
|aaaaa |bbbbb |cccccc |
|aaaaa |bbbbb |cccccc |
|aaaaa |abcd\
eeeeeeeeeeeeee|cccccc |
|aaaaa |bbbbb |cccccc |
|aaaaa |bbbbb |cccccc |
|aaaaa |bbbbb |cccccc |
Earlier, I had installed the betterFormatterPlugin from
http://knighjm.googlepages.com/knightnet-default-tw.html#betterFormatterPlugin
. Now some might say this is a bit of a kludge, but the code is short
and sweet, and it seems to suit the purpose very well, so I just added
the following to the plugin:
text = text.replace( /\\\n\s*/mg, "<html><br /></html>" );
It worked!
But since I'm new to most of this, I thought I'd ask for comments or
suggestions to do it better. Advice and opinions welcome.
Also, could someone tell me how to make the text in each cell be
"top-justified" instead of being vertically centered?
Sitaram
you wrote:
> I need to have multiple lines within a cell in a table.
...
> the text is usually short and very localised
...
> http://knighjm.googlepages.com/knightnet-default-tw.html#betterFormatterPlugin
...
> I just added the following to the plugin:
> text = text.replace( /\\\n\s*/mg, "<html><br /></html>" );
Here's a few suggestions:
TW has a built-in macro: <<br>> that adds a newline into the content.
Your example can be written *today*, without any need for plugins,
using this syntax:
> |aaaaa |bbbbb |cccccc |
> |aaaaa |abcd<<br>>eeeeeeeeeeeeee|cccccc |
> |aaaaa |bbbbb |cccccc |
If you use betterFormatterPlugin to achieve the results you want, and
then someone copies a tiddler that includes the variant formatting
syntax added by the plugin, it won't render correctly when
pasted/imported into another TW document, unless they also have
betterFormatterPlugin installed. Further, because you are modifying
the plugin, then they have to copy/install YOUR version, even if they
already have betterFormatterPlugin installed in their document. This
makes your content relatively non-portable. If you don't expect anyone
to ever copy and re-use your content, then this is probably not an big
issue...
However, when you alter a plugin that you copy from somewhere else, it
is very important to *differentiate your altered version* from the
original, official distribution, since anyone who visits your site may
copy and install THAT version into their documents. Since tiddlers are
identified by their title, this means that you should, at least, alter
the TITLE of the plugin tiddler (i.e., "betterFormatterPlugin_Sitaram")
so that it doesn't conflict and overwrite the original version.
Of course, anyone can rename that tiddler once they copy it, so you
should also prominently comment the plugin code somewhere near the top
of the tiddler (where it is easily seen without scrolling). You should
also place comments directly at the location where you made the
changes, so that those specific code changes are also easily found.
HTH,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
TW has a built-in macro: <<br>> that adds a newline into the content.
Your example can be written *today*, without any need for plugins,
using this syntax:
> |aaaaa |bbbbb |cccccc |
> |aaaaa |abcd<<br>>eeeeeeeeeeeeee|cccccc |
> |aaaaa |bbbbb |cccccc |
precisely. As long as it is for you own use, whatever you do is fine.
It is only when TW documents are shared or published that these issues
of naming and commenting are applicable. (and even then, they are
simply guidelines for avoiding confusion, rather than "rules" or
"standards")
> [Now, if you're saying "why in blazes are you using TW for a phone book, why
> don't you use application X" that's a different question...!]
Actually, I'm more likely to say "why are you using application X... TW
can do that and so much more!!"
ah! I see what you mean... one of the goals of wiki-syntax is to make
the *source* content easier to understand by making it visually similar
to the rendered output it produces. I think your idea (using \ to
quote the newlines) provides a reasonable visual alternative to
embedding <<br>> macros.
Check out: http://www.TiddlyTools.com/#CoreTweaks
It now includes a 'hijacked' version of wikify() that pre-processes the
source input and replaces occurences of "backslash-newline-whitepace"
with "<<br>>" before passing it on to the standard core wikify(). With
this tweak in place, the following syntax use-cases are now possible:
| table cell\
on multiple\
lines |
* bullet\
on multiple\
lines
!!heading\
on multiple\
lines
Note that this change will only let you use "backslash-newline" within
wiki-syntax. It won't work within <html>...</html> blocks (unless you
also have HTMLFormattingPlugin installed), nor will it work to embed a
newline in a macro parameter (use literal "\n" in macros)
enjoy,
to the rendered output it produces. I think your idea (using \ to
quote the newlines) provides a reasonable visual alternative to
embedding <<br>> macros.
Check out: http://www.TiddlyTools.com/#CoreTweaks
It now includes a 'hijacked' version of wikify() that pre-processes the
It now includes a 'hijacked' version of wikify() that pre-processes the
Cool, thanks!
Since the original idea is Jeremy's, any chances of this being included in a future release of the core?
My vote, too! I have waited for a whole year to see multi-line table
cell formatter!
>
> Plus while where are on the topic why is <<br>> a macro? Can we remove
> <<br>> as a macro and make it a formatter with syntax as <br> instead of
> <<br>>. I guess keep the old macro as a backward compatibility plugin (but I
> won't miss it).
Or just "backslash-linefeed-whitespace" and the old <<br>> is enough :)
Cheers.
Martin Budden advocates adding MediaWiki's extended table formatting
which is a kind of "rolled-out" table format that supports things as
complex as tables embedded within tables:
http://meta.wikimedia.org/wiki/Help:Table
> Plus while where are on the topic why is <<br>> a macro? Can we remove
> <<br>> as a macro and make it a formatter with syntax as <br> instead of
> <<br>>. I guess keep the old macro as a backward compatibility plugin (but I
> won't miss it).
I don't recall why we made it <<br>>; I have a feelng it was just expediency.
Cheers
Jeremy
> Simon.
>
>
>
> --
> Simon Baird <simon...@gmail.com>
>
> >
>
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
Anyone making tables that complicated should be using
<html><table>
<tr><td>foo</td></tr>
</table></html>
Which is an alternative syntax that will always work...One has to
understand HTML tables anyway to understand how to make/format more
complicated tables.
--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]
Somewhere, something incredible is waiting to be known. - Carl Sagan
Jeremy Ruston [jeremy...@gmail.com] wrote:
>
> > I vote yes for this. Multi lines in table cells is very useful and the
> > <<br>> solution is quite painful if you have a lot of data in a cell.
>
> Martin Budden advocates adding MediaWiki's extended table formatting
> which is a kind of "rolled-out" table format that supports things as
> complex as tables embedded within tables:
>
> http://meta.wikimedia.org/wiki/Help:Table
Anyone making tables that complicated should be using
<html><table>
<tr><td>foo</td></tr>
</table></html>
Which is an alternative syntax that will always work...One has to
understand HTML tables anyway to understand how to make/format more
complicated tables.
--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]
Somewhere, something incredible is waiting to be known. - Carl Sagan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFE/avCjwioWRGe9K0RAoubAJ9yO5kosSSs/SAvUewaS3yF2QoLwACdEgGu
nk7r1ia74cvDVdAsrf/nze4=
=kQfi
-----END PGP SIGNATURE-----
On 9/5/06, Bob McElrath <bob.mc...@gmail.com > wrote:Jeremy Ruston [ jeremy...@gmail.com] wrote:
>
> > I vote yes for this. Multi lines in table cells is very useful and the
> > <<br>> solution is quite painful if you have a lot of data in a cell.
>
> Martin Budden advocates adding MediaWiki's extended table formatting
> which is a kind of "rolled-out" table format that supports things as
> complex as tables embedded within tables:
>
> http://meta.wikimedia.org/wiki/Help:Table
Anyone making tables that complicated should be using
<html><table>
<tr><td>foo</td></tr>
</table></html>
I'd have to agree with Bob here. It seems it would just as easy for a newcomer to learn the html syntax for tables, as for that formatter. As a plugin some people might find it useful, but I seriously doubt that we need it in the core.
Cheers,
Saq
Maybe htmlplus is not a good word but you get the idea. Actually I have been looking at Textile (via RadiantCMS) and it lets you put html tags in by default I think.
--
Simon Baird <
simon...@gmail.com>
Yes you can:
<html>
<table><tr><td>
</html>
!Left
* item 1
* item 2
<html>
</td><td>
</html>
!Right
* item 3
* item 4
<html>
</tr></table>
</html>
Nested tables I can live without. But <html> is not a full solution.. Eg, I can't do this:<html><table><tr><td>!Left* item 1* item 2</td><td>!Right* item 3* item 4</tr></table></html>
Martin
you say "Anyone making tables that complicated should be using..."
I disagree. Who are we to say what people *should* be using? I say let
people use what they want. There are plenty of people who have used
wikipedia tables and know the syntax well. If they prefer to use that
to HTML tables then I say let them.
By the way, I'm not advocating replacing Tiddlywiki table syntax for
simple tables, rather I'll be doing a Mediawiki table plugin, so that
people will have the choice of Tiddlywiki tables, Mediawiki tables or
HTML tables.
Martin
Well, to create HTML tables with the mediawiki syntax, you have to be
thinking the HTML syntax in the back of your head, which is just an
extra layer of complication.
As it is the table formatter is by far the largest Formatter. From
experience (with Structured Text), this will incur a largest number of
bugs and be very difficult to maintain.
There are certian things the wiki idiom/syntax are great for. The wiki
insight is that the input should be readable and quick to type.
*emphasis*, //italics//, #lists, !headings etc are short, easy to type,
and superior to grabbing the mouse and finding the right toadstool to
look under to accomplish the same thing in e.g. MS Word. Tables, on the
other hand, require tedious edits and re-edits to make the positioning
look right and make the input readable. Consider:
| apples | oranges | banannas |
| $1.99 | $2.99 | $0.39 |
Inserting a column is a tedious exercise to space out all the other
columns and re-align all the '|'. This is not quick and is only
readable with much work. One often ends up instead with unreadable
garbage like
|apples|oranges|banannas|
|$1.99|$2.99|$0.39|
which is unmaintainable if you ever have to go back and edit it. Wiki
tables do not obey the wiki philosophy. I'd go so far as to say that
tables should be stripped from wikis. They're just a headache.
If one wants to create tables a way to do it in HTML should be provided,
or someone needs to have a new idea. The table editors of most WYSIWYG
textarea replacements (FCKeditor, htmlArea, Kupu, TinyMCE) are quite
interesting. I would REALLY like to see TiddlyWiki replace the textare
with a more reasonable editor, along the lines of these projects, but
not WYSIWYG. One would type wiki syntax. Perhaps it could be marked up
as you type, but that is not the point. (The point is to make a better
simple text editor than textarea) If we had such a thing, then an
interactive table editor could be possible.
To put it another way, most text creation does not require the use of
the mouse. (e.g. making things bold) Wiki syntax is superior in these
instances. But tables REALLY require the mouse. For that matter any
kind of page layout also requires the mouse. The table above becomes
about specifying presentation, whereas you can argue every other kind of
formatter is specifying content.
Another way to look at it is that wiki input is 1-dimensional, while a
table is 2-dimensional. Of course you can encode a 2-dimensional object
into a 1-dimensional syntax, but it will always be a pain. That we
divide the 1-dimensional input into "lines" which we place on top of one
another almost makes this seem like a reasonable thing to do. But make
no mistake, having to reposition the location of your column separators
'|' by hand makes it clear that this is a 1-dimensional input task.
> By the way, I'm not advocating replacing Tiddlywiki table syntax for
> simple tables, rather I'll be doing a Mediawiki table plugin, so that
> people will have the choice of Tiddlywiki tables, Mediawiki tables or
> HTML tables.
As a plugin, it's great! ;) Go for it!
The TidIDE tiddler editor includes a incremental preview that renders
wiki markup as you type each character into the textarea input field.
It can also show you the rendered HTML equivalent to the wiki syntax
(so you can actually see the "<table><tr><td>..." generated by the "|
wiki | table |" syntax)
http://www.TiddlyTools.com/#TidIDEPlugin
The TidIDE tiddler editor includes a incremental preview that renders
wiki markup as you type each character into the textarea input field.
It can also show you the rendered HTML equivalent to the wiki syntax
(so you can actually see the "<table><tr><td>..." generated by the "|
wiki | table |" syntax)
http://www.TiddlyTools.com/#TidIDEPlugin
enjoy,
The TidIDE tiddler editor includes a incremental preview that renders
wiki markup as you type each character into the textarea input field.
It can also show you the rendered HTML equivalent to the wiki syntax
(so you can actually see the "<table><tr><td>..." generated by the "|
wiki | table |" syntax)
http://www.TiddlyTools.com/#TidIDEPlugin
enjoy,
on the grounds of interwiki compatibility, can I ask you to change this
to use double backslash for the line break, ie:
| table cell\\
on multiple\\
lines |
* bullet\\
on multiple\\
lines
since some wikis which have paragraph formatting use a single backslash
to join lines and double backslash for line breaks.
Martin
Jules.
Hi Sit, nice to know someone is using my code!!
You might also have checked out the summary of TW formatting that is in
the same location to find the <<br>> formatter.
Jules.
The whole point to me of wiki syntax is to make it quick and easy to
write text - this fails if the text you have to write cannot easily be
read when editting it. My mods add just a little flexibility, mainly by
allowing leading whitespace.
I would have to say though that Eric's code is cleaner. If I ever get
any time, perhaps I'll clean mine up and re-issue.
I certainly like your extension though and I think I'll use add it to
my code when I get a chance. Line breaks in tables really are a pain in
the neck even though they are a very common requirement.
On the point of more complex table wiki formatting. I'd have to agree
that the mediawiki and similar formatting is a step too far for most
people. I would vote for a method to drop back into wiki formatting
from within <html> formatting. Perhaps a <wiki></wiki> tag? That would
be in keeping with the surrounding html.
Whilst we are on wishlists for tables, I'd like a different option for
justification of text within cells as I would REALLY like to use
whitespace sensibly within the text without it making a mess of the
layout.
Cheers all,
--
Julian
http://knighjm.googlepages.com/knightnet-default-tw.html
As you already know, the TW core support for HTML doesn't let you embed
wiki-syntax within an <html>...</html>. Fortunately, there is a plugin
that *does* let you mix TW wiki-syntax within HTML:
http://www.TiddlyTools.com/#HTMLFormattingPlugin
After the browser processes the HTML syntax, this plugin recursively
finds the "text node" DOM elements generated by the browser and then
invokes wikify() on each. The result is that you can do something
like:
<html><table><tr><td>...TiddlerName...</td></tr></table></html>
and the TiddlerName will be a clickable tiddler link.
Martin