Tags:
archive_me1Add my vote for this tag create new tag
view all tags
I find that large tables are difficult to work with in the edit screen.

We often have multi-row and multi-column tables with large amounts of text in individual cells. It quickly becomes difficult to visually parse the table, while editing, looking for row starts. For example (yes, this was a correctly formatted table until I wrapped it in < pre > and added carriage returns):

| *heading 1* | *heading 2* | *heading 3* | *heading 4* |
|first cell of text | mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do | blah blah blah more
stuff more stuff random characters foo |
| next text of foo cell |foo blah blah random characters entered by someone who
obviously has nothing better to do blah more stuff | blah blah blah more stuff
more stuff blah blah blah more stuff | mix of stuff random characters |
|first cell of text| mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do blah blah | blah blah
blah more stuff more stuff random characters |
| next text of cell | random characters entered by someone who obviously has
nothing better to do blah blah blah more stuff | blah blah blah more stuff more
stuff blah blah blah more stuff | mix of stuff random characters foo foo foo |
| first cell of blah blah text | blah blah mix of stuff blah blah blah more
stuff | random characters entered by someone who obviously has nothing better to
do | blah blah blah more stuff more stuff random characters |

(removed some of the above text to make page shorter -- PeterThoeny - 13 Sep 2000)


I propose that the rules regarding vertical space be relaxed a bit for tables. This would become much easier to read with a blank line between each row of the table. A blank line followed by a character other than | would terminate the table. For example:

| *heading 1* | *heading 2* | *heading 3* | *heading 4* |

|first cell of text | mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do | blah blah blah more
stuff more stuff random characters foo |

| next text of foo cell |foo blah blah random characters entered by someone who
obviously has nothing better to do blah more stuff | blah blah blah more stuff
more stuff blah blah blah more stuff | mix of stuff random characters |

|first cell of text| mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do blah blah | blah blah
blah more stuff more stuff random characters |

| next text of cell | random characters entered by someone who obviously has
nothing better to do blah blah blah more stuff | blah blah blah more stuff more
stuff blah blah blah more stuff | mix of stuff random characters foo foo foo |

Any thoughts?

-- JohnAltstadt - 13 Sep 2000

How about inserting leading spaces to make it more readable? This is already possible (was done in order to allow tables in a bulleted list). Taking your example:

	  | *heading 1* | *heading 2* | *heading 3* | *heading 4* |
	  |first cell of text | mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do | blah blah blah more
stuff more stuff random characters foo |
	  | next text of foo cell |foo blah blah random characters entered by someone who
obviously has nothing better to do blah more stuff | blah blah blah more stuff
more stuff blah blah blah more stuff | mix of stuff random characters |
	  |first cell of text| mix of stuff blah blah blah more stuff | random characters
entered by someone who obviously has nothing better to do blah blah | blah blah
blah more stuff more stuff random characters |
	  | next text of cell | random characters entered by someone who obviously has
nothing better to do blah blah blah more stuff | blah blah blah more stuff more
stuff blah blah blah more stuff | mix of stuff random characters foo foo foo |

As you see, this is gets readable in edit mode.

We could extend as per your suggestion. Things to consider:

  • An item of list (bulleted, numbered or definition) can have more then one line. Leading space defines follow up lines. Your rule would not be applicable for tables inside lists, because an empty line is closing a list.
  • An empty line is currently a paragraph. If we add your rule it has two meanings, depending on the context. Questions: Is this intuitive for users? Can the code be clean and readable?

-- PeterThoeny - 13 Sep 2000

Thanks. I didn't realize the indents could be used all the time. I thought they only made sense when inside a list.

The code:

|*foo*|*bar*|
	|more foo|more bar|
		|yet more foo|yet more bar|

renders as:

foo bar
more foo more bar
yet more foo yet more bar

-- JohnAltstadt - 14 Sep 2000

Leading space will interfere with ImplicitPreOrBlockquote once implemented. So, the safest is not to use leading space for the first line of the table. Example:

|*foo*|*bar*|
	  |more foo|more bar|
	  |yet more foo|yet more bar|

IMO we should not extend the table rule with empty lines because this would interfere with the new paragraph rule. Leading space should be OK for visual separation.

-- PeterThoeny - 14 Sep 2000

Could we make this even more flexible? I often want to create a table with mulitple lines in one cell and end up doing html tags but many of our users are not comfortable with them.

How about reading a row until you find a | at the end of the line?

| *Name* | *Address*			  | *Phone* |
| Fred	| 123 Sandstone Ave<br>
			  Bedrock				 | Voice: (888)555-1212<br>
											Fax: (888)555-1211 |
| Barney | 125 Sandstone Ave<br>
			  Bedrock				 | Voice: (777)555-1212<br>
											Fax: (777)555-1211 |

produces:

Name Address Phone
Fred 123 Sandstone Ave
Bedrock
Voice: (888)555-1212
Fax: (888)555-1211
Barney 125 Sandstone Ave
Bedrock
Voice: (777)555-1212
Fax: (777)555-1211

-- BruceWilson - 31 Jan 2001

This has been discussed also in TableExtensionProposal. I prefer not to extend the TWiki core with this syntax because it could have unexpected side effects.

-- PeterThoeny - 31 Jan 2001

I discovered an undocumented feature while reading the code. There is a way to connect lines with a trailing '\' backslash character. This can be used to write readable tables:

You write:

| first row \  | more \  | more \  | no more |
| second row \  | more \  | more \  | no more |

You get:

first row more more no more
second row more more no more

Note: There is a bug in this undocumented feature. You need to reverse the two lines shown in red (after the change) in sub getRenderedVersion of wiki.pm:

	 $code = "";
	 $text =~ s/\r//go;
	 $text =~ s/\\\n//go;
	 foreach( split( /\n/, $text ) ) {

-- PeterThoeny - 10 Feb 2001

TopicClassification:
FeatureDone
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2001-02-10 - 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.