Tags:
create new tag
, view all tags
See Support: IsitPossibletoHaveTwistyTableRows.

Most of the tests below work--at least in konqueror version 3.4.2. with javascript turned on globally. If you don't have javascript enabled, you will have to enable it and then restart konqueror to make it work. (It should work in any Javascript enabled browser.)

To demonstrate, click on the text below either of the headings--that text will disappear. To make it reappear, click on the heading above the text that disappeared.

This demo works by alternating the style.display between "inline" and "none". Some other tests, alternating between "block" and "none" didn't seem to work (on the first try) so I deleted them to make the page less cluttered.

To make this example prettier, you could add say a + in square brackets and make the onclick property apply to that. (I've done that in some offline tests.)

At the bottom of this page, I have some notes to myself (commented with HTML comment markup) to jog my memory as to where I have my notes and test files (from some time ago).

test1

These are a few short paragraphs for test.

With Javascript enabled, click here to hide this text.

Afterwards, click on the heading above to view this text again.

These are a few short paragraphs for test.

test2

With Javascript enabled, click here to hide this text.

Afterwards, click on the heading above to view this text again.

A bulleted list--it could just as well be a table or part of a table:

  1. The "opposite" of visibility="hidden" is visibility="visible"
  2. The opposite of display="none" is display="inline" or display="block"--I don't know the difference, so far they seem to work the same.

Trying to do the same thing for a table with TWiki markup

test3

line 1 a short table using TWiki markup
line 2 a fixed line
line 3 the foldable area
line 4 click test3 to redisplay
line 5 end of the foldable area
line 6 a short table using TWiki markup
line 7 a short table using TWiki markup
line 8 a short table using TWiki markup

Hmm, this (the above) works somewhat, but there is a fairly obvious problem--TWiki doesn't consider it one contiguous/continuous table but instead three (separate) tables. It might work to display the entire table using HTML markup instead of TWiki markup--I'm not sure I want to bother. Let's see:

test4

line 1 a short table using HTML
line 2 a fixed line
line 3 the foldable area
line 4 click test4 to redisplay
line 5 end of the foldable area
line 1 a short table using HTML
line 1 a short table using HTML
line 1 a short table using HTML

Nope, now the folding doesn't work. I suspect I'm running into some limitations of HTML.

My Notes

the status discussed below is not accurate, as I did get the above working

BTW, the two books listed below gave me (most of) the information I needed to do the test described here as well as some other tests I did off line quite some time ago.

  • Teach Yourself Javascript in 24 Hours, Michael Moncur, 4th Edition (Covers JavaScript 1.5 and Ajax), Sams, 2006, ISBN 0-672-32879-8--of the two books I thought this was the better book (maybe more traditional?). Remember the my first goal was writing some JavaScript for kate (timestamps), and not everything works in Kate the way it does in a browser. Two examples: document.write does not work in kate, I had to use document.insertText or .insertLine, and, I don't think (but I could be wrong) that there is a DOM for the text in a Kate file.

  • Javascript, Eric Pascarello, 2nd Edition, Wiley (Visual: Read Less, Learn More), 2004, ISBN 0-7645-7497-3--I'm not sure I like the Read Less, Learn More presentation (I like the idea ;-), but I did find some examples in the book that were useful--I'll have to find them again. Sent a question to wiley.custhelp.com about the blank (no text) blue areas on various pages (like page 54 at arrows 1 and 3).

The example that got me started was on page 58 of the 2nd book and included this key line:

<p onclick="alert('apple')">test</p>

Topic revision: r4 - 2010-08-09 - RandyKramer
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? Send feedback
See TWiki's New Look