I very like your module: it really simplify life of our content-managers. But I have one issue.

When merging last cell in the row to the left you always get cell with { symbol. Last cell don't want to merge.
We can see this even on demo-page, when using this construction:

[table=tables-grid | Month |{ |{ |{
Direction |Jan | Feb | Mar | Apr
East| 7 | 14 | 21| 28
West | 7 | & | ^| 28
North| 7 | 14 | ^| 28
South | 7 | 14 | ^| 28 ]

How can I fix this?
Thanx!

Comments

cmrabet’s picture

I am having the same issue here. The module is quite good, but unfortunately it might be not usable if tables need to have a final colspan which is very common. Pity.

monti’s picture

1. same problem when last field is merged upward

2. workaround: add an empty field at the end. i.e: another "|" mark for all rows

cmrabet’s picture

I don't understand the workaround you say; If I add another | at the end of each row then I get an empty cell on the final table which I don't want. The module does not generate a class for the last col, so in that case through CSS I could hide the inner borders for the last column to trick the user thinking that is the same column as the before the last one, but unfortunately the module only generates class for the first column, and then it keeps going with odd, even, odd, even, etc...

ManyNancy’s picture

Yep, extremely problematic. :(

tumblingmug’s picture

Quick solution is: you have to rearrange the order of input formats. If the table filter runs after the line break converter (and it does by default) then the last cell containing whatever will get an break appended and this does not fulfill the hardcoded conditions for colspans anymore.

More robust would be inside the code instead of:

   if ($cells[$j][$k]=='{') {

to have this on line 94:

   if ($cells[$j][$k][0]=='{') {

and as well to write on line 136 instead of

    if ($cells[$j][$k]!='^' && $cells[$j][$k]!='{') {

this:

    if ($cells[$j][$k]!='^' && $cells[$j][$k][0] != '{') {

The same would apply then to the '^'-conditions on lines 102 and 136.

Cheers.

tumblingmug’s picture

Status: Active » Needs review
StatusFileSize
new2.29 KB

Here a patch for this. Also cleaning a confusing typo of the help text.

realityloop’s picture

Status: Needs review » Fixed

Added to dev, thanks for the patch!

I will push a release within 2 weeks if there are no bug reports relating to it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.