create new tag
, view all tags
Unless I've missed it, there's currently no way to handle the ROWSPAN attribute for WikiTableSyntax.

Basically, how would you construct a table such as :

Row Spanner single
another single
last single
column spanning line

It may not seem like much of a problem, but a lot of my documents contain such tables, and it's unfortunate that I have to resort to using inline table code for some, whereas I can use the nice WikiTableSyntax for others.

-- MichaelKearns - 05 Jan 2003

Hrmm...perhaps something like this:

|3 Row Spanner | single |
|| another single |
|| last single |
| column spanning line ||

To produce the above? Most tables I've seen have spaces after the opening bars, so that shouldn't conflict with the majority of existing syntax. Maybe TableSyntax or TablePlugin requires this, I'm not sure yet. However this syntax is very unintuitive; at first glance you'd never know what the above was trying to accomplish. Also, it gets confusing when you start combining column- and row-spanning table entries, like this:

| Single 1 | Single 2 |3 Row spanner |
| Column Spanner |||
| Single 1 | Single 2 ||

Any better ideas?

-- WalterMundt - 08 Jan 2003

Another idea:

| Row Spanner | single |
|^| another single |
|^| last single |
| column spanning line ||
I think that pretty neatly solves both of the above issues I mentioned. Any problems with this?

-- WalterMundt - 08 Jan 2003

I really like that last idea, and I can't think of any problems. If somebody really wanted to have a single ^ in a cell, they could escape it with a < nop > tag.

Now we just need someone (with Perl knowledge) to implement it !

-- MichaelKearns - 08 Jan 2003

I like WalterMundt's proposal, too. Very visual. Just one glitch: from the first row parser cannot tell this is going to be row span. What about placing cell contens into last row, like:

|^| 1st single |
|^| another single |
| Row Spanner | last single |
| column spanning line ||

Possibly easier to implement. I did not volunteered... wink

-- PeterMasiar - 08 Jan 2003

That's true. However, it's no different to the column spanning, and it could multi-pass the table once it finds the end. I think the first way is more useful to the user, and that should be the main priority. I might have to re-learn perl, and see if I can start it !

-- MichaelKearns - 08 Jan 2003

I personally disagree with putting the contents in the last cell and then using a ^ character. The whole point of the ^ is to represent the idea that the content is given above for that cell. If you think it'd be that much easier with the content below, use v's, like this:

|v| 1st single |
|v| another single |
| Row Spanner | last single |
| column spanning line ||
See what I mean?

(Note: I just changed my name from EtherMage to WalterMundt at PeterThoeny's request; I'm not stealing EtherMage's contributions.)

Also note that preloading the entire table would be unnecessary and inefficient for large-table pages. Instead, you could just hold a row in a cycling list until you know that none of the cells from that row need spanned any further, then print out the HTML for that row. This eliminates the need to post-process the entire table at once. Note that that does considerable complicate the code...maybe it would be worth it to use content at the bottom, as PeterMasiar suggested. Implementor gets to decide, I guess.

-- WalterMundt - 08 Jan 2003

I've made up a patch that implements my second ("|^|") row-spanning syntax. It's against the 20021229 beta. If at a glance it looks worth integrating into the core, I'll get myself a copy of the latest alpha and make a version of the patch that'll work there. It's a pretty extensive modification of the table-formatting code, so it probably won't patch neatly unless that stuff hasn't been touched since the beta I'm using.

To see this in action, visit this sandbox page on my TWiki.

-- WalterMundt - 16 Jan 2003

Hey Walter, that works great... I'm running the CVS of 6th Jan, but TWiki.pm was still from the beta, so it patched neatly. It seems to handle most things, and will solve all my current needs I think.

One nice additions would be for it to work on columnspanned rows as well. for example:

|  *test*  |  *header*  |  *another*  |
| rowspan  |   data2    |    data3    |
|^|            colspan  ||
|   end    |^||
|  blank   |||

I think that should show most cases. It would also be a nice feature if you could have whitespace either side of the ^, as then you can format the tables a bit nicer in the editor (maybe it's only me that does that !).

Anyway, thanks for the great patch. Hopefully it will make it into the release...

-- MichaelKearns - 16 Jan 2003

...And now for the not so great news.

It seems it doesn't play nicely with the TablePlugin. Hopefully something can be worked out.. ?

-- MichaelKearns - 16 Jan 2003

Okay, I'll address your concerns in order:

  1. The above table layout is flawed because of the way HTML tables work. Since every cell is row-spanned from above, they all get collapsed to 1 line tall, even though they each consist of 2 "rows"...that's why all the little '*' cells in my sandbox test. Rowspanning a colspanned table does indeed behave; my sandbox now has that table with an asterisk cell added to the end of each column for effect.
  2. Whitespace around the ^...will make it into the next version of my patch. Then you'll have to escape single-^ cells, but that's life.
  3. I haven't looked at the code for TablePlugin, but my theory is that it snarfs table syntax and does its own conversion to HTML before the rendering code that I made my changes to can get access. So any changes made here will probably need a parallel patch in TablePlugin to do the same stuff. Since TablePlugin already deals in whole tables at a time, the changes should be much more trivial.

-- WalterMundt - 16 Jan 2003

I've updated the patch to get rid of PerlFunctionPrototypes and handle whitespace around ^'s, as well as fixing a small bug that could distort the order of output of things immediately before or after a table. Still probably doesn't play well with TablePlugin. Note that the patch is for an unmodified TWiki.pm...so MichaelKearns, you'll need to get a fresh copy to patch.

-- WalterMundt - 16 Jan 2003

Why not make this a Plugin rather than a patch?

-- JohnTalintyre - 16 Jan 2003

Well, if anything, this can (and probably will once I get around to it) be an enhancement to TablePlugin, which upon a glance at the code uses a remarkably similar setup for rendering tables to the one I worked out here.

I'm loathe to add yet another table-rendering plugin. We already have what seem to be effectively 3 seperate and mutually exclusive table-rendering pipelines (TablePlugin, SpreadSheetPlugin, and the base code)...do we really need more?

However, there are a couple of reasons this might make it into the core code: it's a pretty basic table-type feature, and complements column-spanning well. Also, despite the increased complexity of the table rendering code, there should really be no performance impact if you don't use it - as it is, it only caches a row long enough to determine that that row's cells aren't being spanned further.

-- WalterMundt - 16 Jan 2003

I agree with Walter on this. At BeijingRelease and other places there is mention of the complexity and problems of adding plugins and what should be in the core code and baseline release. While I have no problems with tar and zip, with taking my own CVS snapshots, I can see how people who are more interested in the aplication than being a sysadmin would find this daunting.

There is also a good case that row-spanning is a basic feature of a table and should be in the core code, since it is more efficient to have it implemented there.

-- AntonAylward - 17 Jan 2003

Thanks for contributing this! I like the |^| syntax; and it is unlikely that just a ^ is used as a table cell text.

Table rendering (with column span) is actually done in the core code and in the TablePlugin. The table rendering of the core code is not used in case the TablePlugin is installed. That means, the rowspan logic should be incorporated into the core code and the TablePlugin as well.

Let's take this into the CairoRelease and the TablePluginDev.

-- PeterThoeny - 18 Jan 2003

I've posted a patch to add this feature to TablePlugin at TablePluginDev.

-- WalterMundt - 19 Jan 2003

Now that BeijingRelease is out the door, you might want to get my patch folded into CVS while it still applies cleanly. Of course, the decision is yours, though.

-- WalterMundt - 02 Feb 2003

I an having trouble with this patch. It removes empty lines between tables and sometimes adds an empty lines before a table. It also breaks tables in a bullet, like:

  • table comes next:
    Country Food
    USA Burger
    Japan Sushi
    this text is after the table.

And it also adds extra blank lines between table rows in the HTML output.

Time to debug...

-- PeterThoeny - 27 May 2003

Now in TWikiAlphaRelease after some debugging; and updated TextFormattingRules.

Note that this patch does not apply if the latest TablePlugin is installed, since the Plugin overrides the row span handling.

-- PeterThoeny - 17 Jun 2003

Wow, that's awesome! I've wanted this for a long time.. !

-- JonathanCline - 21 Jun 2003

Sorry I couldn't handle the debugging myself, Peter. I've found myself with very little spare effort for stuff like this lately, so it just kept getting put off. Thanks for doing the extra work to get it integrated though! I hope to start contributing more again in a week or two.

-- WalterMundt - 22 Jun 2003

This feature is currently coded in two places: in the TWiki core and in the TablePlugin.

The rowspan feature has a bug which manifests itself only if the TablePlugin is not installed: The last row does not get rendered correctly. For example, =fixed font= markup is shown unrendered. This could be fixed in TWiki.pm, but:

I would like to see the TablePlugin shipped with TWiki, and the rowspan feature taken out of the core. This scales better and reduces the complexity of the core code. The rowspan documentation in TextFormattingRules can be left as is since the Plugin is shipped with TWiki.


-- PeterThoeny - 16 Oct 2003

I'd also like to see TablePlugin shipped with TWiki.

-- MorbusIff - 01 Dec 2003

I removed the rowspan code from the TWiki core because it removes duplicate code and it fixes the LastTableRowNotWikiWorded issue.

New as of today: TWikiBetaReleases and TWikiProductionReleases will ship the TablePlugin preinstalled.

-- PeterThoeny - 02 Dec 2003

Category: TWikiPatches
Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch rowspan.alpha.patch r1 manage 6.5 K 2003-01-17 - 07:49 WalterMundt Rowspan patch for TWikiAlpha20030112
Unknown file formatpatch rowspan.patch r2 r1 manage 6.5 K 2003-01-16 - 21:41 WalterMundt Rowspan patch for TWikiBeta20021229
Edit | Attach | Watch | Print version | History: r30 < r29 < r28 < r27 < r26 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r30 - 2004-08-16 - PeterThoeny
  • 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-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.