Ticket #315 (closed defect: fixed)

Opened 5 years ago

Last modified 2 years ago

Problems with collapsed cells in tables

Reported by: JeremyRuston Owned by: MartinBudden
Priority: minor Milestone: 2.6
Component: core Version:
Severity: medium Keywords:
Cc:

Description (last modified by JeremyRuston) (diff)

There are a number of problems with collapsing cells in tables documented  here:

Here are a few examples that puzzle me, you can try those examples in TW: 

the 2x2 section is displayed as I expect here 
|!one|!two|!three| 
|>| 2x2 |1| 
|>|~|1| 

But when I try to move the 2x2 section on the "right" of the array, 
problems start to appear: 
what should I do? 
|!one|!two|!three| 
|1|>| 2x2 | 
|1|>|~| 

Then when I add a row to the previous example, a "fourth column" 
mysteriously appears: 
|!one|!two|!three| 
|1|>| 2x2 | 
|1|>|~| 
|~|x|y| 

Another example. This table displays only two rows instead of three 
|!one|!two|!three|!four| 
| 1x2 |>| 2x1 |a| 
|~|b|c|d| 
|e|~|~|~| 

And yet, when I add one more value in the last row, the table now 
displays correctly 
|!one|!two|!three|!four| 
| 1x2?? |>| 2x1 |a| 
|~|b|c|d| 
|e|~|f|~| 

Change History

Changed 5 years ago by JeremyRuston

  • description modified (diff)

Changed 5 years ago by MartinBudden

  • priority changed from undefined to minor
  • severity changed from undefined to medium
  • milestone set to 2.3

Changed 4 years ago by MartinBudden

  • milestone set to 2.3.1

Changed 4 years ago by MartinBudden

  • milestone changed from 2.3.1 to 2.4

Changed 4 years ago by MartinBudden

  • milestone changed from 2.4 to 2.5

Changed 3 years ago by FND

  • milestone changed from 2.5 to 2.6

Changed 3 years ago by hanham

I think the problems with the collapsed cells can largely be solved by additionally setting the colSpan when parsing a ~ in the rowHandler function eg.

if(cellMatch[1] == "~")	{
  // Rowspan
  var last = prevColumns[col];
  if(last) {
    last.rowSpanCount++;
    last.element.setAttribute("rowspan",last.rowSpanCount);
    last.element.setAttribute("rowSpan",last.rowSpanCount); // Needed for IE
    last.element.valign = "center";

    if(colSpanCount > 1) {
      last.element.setAttribute("colspan",colSpanCount);
      last.element.setAttribute("colSpan",colSpanCount); // Needed for IE
      colSpanCount = 1;
    }
  }
  w.nextMatch = this.cellRegExp.lastIndex-1;
}

This at least results in html that I would expect. This doesn't always display well as some multi row cells are squashed by the browser and appear to be single row.

Changed 3 years ago by FND

  • milestone changed from 2.6 to 2.5.3

Thanks hanham, we'll look into that for the next release.

Changed 3 years ago by FND

  • milestone changed from 2.5.3 to 2.5.4

Changed 2 years ago by MartinBudden

  • owner set to MartinBudden
  • status changed from new to assigned

Changed 2 years ago by MartinBudden

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in changeset:11300

Note: See TracTickets for help on using tickets.