Page MenuHomePhabricator

Tables - multiple colspan and rowspan are not displayed correctly
Open, LowPublic

Description

Correct table display - Edit mode

Steps to reproduce:

  1. In VE insert a table and edit the table with mergining cells to get the following structure(or something similar) - look at the attached screenshot- colspan_rowspan_CORRECT_display:

<table class="wikitable">
<tbody><tr>
<th colspan="4" rowspan="2"></th>
</tr>
<tr>
<th colspan="2" rowspan="2">Header 1</th>
<th>Header 2</th>
<td></td>
</tr> -

  1. save the table - the saved table format will be different - look at the attached screenshot - saved_table_with_multiple_colspan_rowspan

Expected: the saved table format should be the same as in Edit mode.


Version: unspecified
Severity: minor

Attached:

colspan_rowspan_CORRECT_display.png (304×238 px, 12 KB)

Details

Reference
bz72790

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:51 AM
bzimport set Reference to bz72790.

Created attachment 16968
Saved table with multiple colspan and rowspan

Attached:

saved_table_with_multiple_colspan_rowspan.png (168×437 px, 11 KB)

Looks like an HTMLTidy change to the DOM?

Basically a table's cells cannot be unmerged via Table menu when multiple merge actions have been applied. Applying un-merge action results in "TypeError: rowCells[col] is null" error.

Another sample of a table that has not un-mergeable cells:
{| class="wikitable"
! rowspan="2" colspan="2" |
! rowspan="2" colspan="2" |

-
}

I suspect that

FooFoo

is bad HTML, as it asks you to span into a row that doesn't exist, in fact

FooFoo
Bar

breaks the renderer in both Chrome and Firefox. An extra, empty, <tr> is required between the two.

I'm putting that part down as wontfix, give that browsers don't even support it.

The first case (merging two whole rows together) exposes a bug in the PHP parser (although not Tidy, because I don't have that locally) whereby and empty row is discarded:

{| class="wikitable"
| colspan="4" rowspan="2" |foob
|-
|-
! colspan="2" rowspan="2" |bar
!baz
!
|-
|
|hee
|-
|quux
|
|
|
|-
|
|foo
|
|
|}

This wikitext renders fine in Parsoid though

  • Bug 72784 has been marked as a duplicate of this bug. ***
Jdforrester-WMF renamed this task from VisualEditor: Tables - multiple colspan and rowspan are not displayed correctly to Tables - multiple colspan and rowspan are not displayed correctly.Nov 24 2014, 2:16 AM
Jdforrester-WMF set Security to None.