Table

| June 9, 2012

The table below illustrates how Chrome does not correctly handle complex rowspan attributes within a table. The table cells displays correctly on Firefox and Internet Explorer.

Column 1 Column 2 Column 3
Col 1, Row 1 Col 2, Row 1 Col 3, Rows 1-4, rowspan=”4″
Col 1, Row 2 Col 2, Row 2
Col 1, Row 3 Col 2, Rows 3-5, rowspan=”3″
Col 1, Rows 4-5, rowspan=”2″
Col 3, Rows 5-8, rowspan=”3″
Col 1, Row 6 Col 2, Row 6
Col 1, Rows 7-8, rowspan=”2″ Col 2, Rows 7-9, rowspan=”3″
Col 3, Rows 8-11, rowspan=”4″
Col 1, Row 9
Col 1, Row 10 Col 2, Row 10
Col 1, Row 11 Col 2, Row 11

The bottom of Col 3/Rows 1-4 should line up halfway between the borders of Col 1, Rows 4-5. Instead, it lines up with the top of Col 1, Rows 4-5 in Chrome (version 19.0.1084.56). It displays correctly in Firefox and Internet Explorer. Likewise, the bottom of Col 3, Rows 5-8 should line up halfway between Col 1, Rows 7-8, but in Chrome, it lines up with the top of that cell.

Note that if you add up all the rowspan values (with rowspan = 1 as the default for those cells where the rowspan attribute isn’t explicitly used), all columns add up to 11.

If you have trouble seeing how the cells line up in Firefox or IE, print this out and use a ruler to draw lines across the bottom of each cell, extending across all columns.

In case you’re wondering if this has a real-world application, yes, this is how I discovered the flaw. I was creating a table showing the years served by the Presidents and Resident Ministers of our temple. The Presidents serve discreet years (i.e., 2002, or 2003-2004, for example), while the Resident Ministers could assume the position, or leave, in the middle of a year. In this case, Rev. Miyaji left the temple in the middle of 2003, and Rev. Iwohara assumed the position in the middle of 2003. And Rev. Miyaji had taken over the position from Rev. Matsubayashi in the middle of 1999:

Years President Resident Minister
2008-2009 Dianne Belli Rev. John Iwohara
2006-2007 Barbara Fukuji
2004-2005 Joe Belli
2003
Rev. Nobuo Miyaji
2000-2002 Billy H. Saeki
1999 Milnes Kurashige
Rev. George Matsubayashi
1998
1996-1997 Kenji Koda
1994-1995 Gene Takahashi
This is the first cellThis is the second cell
This is the second rowThis is cell B2

One thought on “Table

Leave a Reply

Your email address will not be published. Required fields are marked *