Feature Proposal: New cell span feature for EditTablePlugin
Motivation
Enable users of
EditTablePlugin a chance to use merged / spanned cells.
Sadly a feature implementation that was meant well turned out to have some negative side effects. But instead of giving up I will try and draft an alternative approach.
First a little more background and here I also want to refer to
Bugs:Item5217
and
Bugs:Item4910
.
EditTablePlugin has never supported cell spans.
Example:
The minute you add an EDITTABLE tag and edit the table and save it again, the plugin will add an empty space in the merged cell and there is a very good reason for this.
In normal use the plugin users will not want to merge cells. They have a table and it contains lots of empty cells. An example from real life. A schedule from a weekly report topic. When a milestone is in the future the date is a Forecast date. When the Milestone is reached the Forecast date is normally cleared (make no sense) and instead Actual field is populated by the actual date. The 3 column format makes the Actuals much more visible vs the forecasts. After having run with a development version of EditTablePlugin that merged empty cells for one week, the complaints came in from the users that the tables were goofed up.
So on one hand we want the merge feature. On the other hand it creates too much trouble when it gets implemented the way
TML invites to make it.
Here is another application that gets goofed up if empty cells are saved with no space between the bars. In this application (also from real life with the text made generic) an engineering team is trying to plan how many submodules they need to order for different kind of products. And the normal way is to leave a cell empty when there is 0 of an item. Especially when the product in question is not compatible with all the modules.
When the user has cleared a cell and saves it with EditTablePlugin it is again important that the cell is left with one space. Otherwise we get surprising and unwanted merges again. But on the other hand it would also be nice if the cell "Total" at the bottom could be spanned across 5 columns. So even within the same table we both want and do not want cells to merge.
So after all this long talk the conclusion is
- It would be nice to be able to work with merged cells in EditTablePlugin. And it would be nice if you saw merged cells as ONE edit field when editing.
- We cannot just let emptied cells be stored without whitespace because that causes unwanted cell spans.
Description and Documentation
First proposal (and I expect several counter proposals)
I propose defining an extension to the EDITCELL syntax which is backwards compatible which defines a cell as merged with the one to the left. And with the possibility to merge several cells. Using span or merge as new type.
For example %EDITCELL{"span"}%.
I would imagine that the
EditTablePlugin would work in two ways then.
In table editing mode it would make the cell invisible and maybe even allow the the cell to the left span.
In normal mode the variable would replace the entire cell content by nothing even removng any whitespace. Since
EditTablePlugin runs before the
TablePlugin it should mean that the rendering will work like normal and the cells would merge.
This can be extended to also work in the vertical direction.
Examples
- %EDITCELL{"span"}% = span horizontally
- %EDITCELL{"span, horizontal"}% = span horizontally
- %EDITCELL{"span, vertical"}% = span horizontally which cause the value of the cell containing the EDITCELL to become " ^ "
Impact
The change will be an extension to
EditTablePlugin only.
In Wysiwyg mode you will see the variable if implemented like this so we may consider some impact here as well to make it more beautiful. But I foresee the use of this in topics mainly edited by either developer OR user using EditTablePlugin edit mode
Implementation
I think the implementation should be not too complicated since we already have the EDITCELL feature and we already substitute the EDITCELL for normal view. The most complex is if we want to actually show the cells merged in edit mode.
--
Contributors: KennethLavrsen - 08 Jan 2008
Discussion