Tags:
create new tag
view all tags

Question

Hi! Does anyone know if it is possible to have a table with a number of rows that one can collapse (as TwistyPlugin do with text)? I have tried with TwistyPlugin, but it fails as the twisty statement split the table in two. Have searched all over, but can't find anything that seems to do this. Any suggestions?

Environment

TWiki version: TWikiRelease04x02x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Ubuntu 7.04
Web server: Apache2
Perl version: 5.8
Client OS: Centos5
Web Browser: firefox3
Categories: Plugins

-- AtleGundersen - 10 Sep 2008

Answer

See Wikilearn: FoldingTest.

I think that almost does what you want, depending on whether you want to hide the entire table or selected rows only. The problem when dealing with selected rows is that those selected rows become an independent table--contiguous with rows preceding or succeeding it, but not of the same width.

I'm guessing that's the same thing you're describing when you say Twisty splits the table in two. I don't see a way around it--maybe someone with more knowledge of HTML knows a way.

-- RandyKramer - 11 Sep 2008

Hi and thanks for learning example. It gave me some hints, so I fooled around the web searching for onclick table examples. Due to the splitting of Twiki tables, I decided to implement my table in HTML together with javaScript, according to this example: http://www.aspcode.net/Javascript-hide/show-multiple-table-rows.aspx Now my table folding is working OK smile

-- AtleGundersen - 15 Sep 2008

You're welcome, and thank you for the aspcode.net link!

-- RandyKramer - 15 Sep 2008

The problem is the TML that does not allow to insert lines between table rows. Using a hardcoded table (using table tags) would also allow you to work with TwistyPlugin.

-- ArthurClemens - 16 Sep 2008

<20140202 Updates / Notes / Rants>

I've recently updated my Wikilearn: FoldingTest page and I'm pretty sure I now know how to make individual rows of a table collapse (and later, re-expand). I haven't actually done the entire thing, but I'm fairly well convinced it can be done, and the "clues" are there on that page (and repeated here)--this all focuses on doing it with HTML / Javascript, not TML:

  • Make each row of the table a separate table and labeled span--unfortunately this seems to be required but makes things very cumbersome--include an onclick "command" to change the display style to "none". I've done enough of this on my Wikilearn: FoldingTest page (see Test4) to convince myself that this will work. A question is whether the table (well the collection of tables) will look like one contiguous table. In my case, it does. If in some other case it doesn't, I'm guessing there are format commands that can be applied to help with that.
  • Make another labeled span that incorporates all of the tables (and all of the rows), and include an onclick "command" to change the display style to "inline". _I haven't tried this on my Wikilearn: FoldingTest page (see Test4)--I might try it at some point, and might not update this page to reflect it--well, unless I find I can't do it.

BTW, I now understand ArthurClements comment about the problem with TML being that you can't insert lines between table rows. As I noted above, each row of the table(s) has to be a separate span, and you need to insert <span> directives between rows in order to do that.

<rant>

The link (http://www.aspcode.net/Javascript-hide/show-multiple-table-rows.aspx) which AtleGundersen included below no longer works. That's not my real rant, links go stale all the time. The rant is this:

  • The author of that page (Stefan Holmberg) has a page (I guess a 404 message) that seems to blame the page with the link on it (i.e., this page) for having a bad link. As I see it, the fault is Stefan Holmberg's for having moved (or even deleted) the linked page. Here's some of the text of that 404 message:

<quote>

Ooops! I can't find the page you're looking for

You were incorrectly referred to this page by:twiki.org

I suggest you try one of the links below:

</quote>

From this, I infer that he thinks the fault is with the referring page. I think the fault is with his site, for moving or deleting the page. I think a more appropriate 404 message would say something like:

<quote>

Ooops! I can't find the page you're looking for

For reasons important to me or this web site, I found it appropriate to move or delete that page.

I suggest you try one of the links below:

</quote>

  • I did find a link to search for the page, and was directed to his blog where I found this:

<quote>

Looking for aspcode.net content? Sorry...I have removed everything and redirecting the domain to this site instead...Why?

About 13 years ago I created the site ASPCode.net and while I had a blast with it, I felt the domain name "aspcode" did put some contraints on me and the content (also the site structure turned into a mess...I mean mixing articles like "Read a textfile with classic ASP" and newer stuff like CQRS/architecture/continous integration etc ).

...

</quote>

Sorry, I'm just in the mood to rant

Oops, update--the webmail link on his page doesn't seem to work, I got this message: "This form does not work at the moment. Sorry for the inconvenience.", so I guess I won't get a response from him.

</rant>

</20140202 Updates / Notes / Rants>

-- Randy Kramer - 2014-02-02

You can use a TWISTY in a table by splitting up the table into sections, provided that the columns in each section have the same width. See example at the plugin info table of NotifyAuthorsPlugin

-- Peter Thoeny - 2014-02-02

Change status to:
ALERT! 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.
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2014-02-03 - RandyKramer
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.