Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-39383

Table with th elements in tfoot block is mangled in Confluence 5.8

    XMLWordPrintable

Details

    Description

      We have an in-house custom plugin which generates tables with extra functionality. The "autoTotal" option causes it to generate a footer row containing totals for any columns of appropriate data types. This plugin works fine in Confluence 5.7.5.

      During testing with Confluence 5.8.10 we discovered that tables with a total row are being modified such that the total row is displayed at the very top of the table (above the header row). When the page first displays it looks right for a second or two, but when it finishes loading the footer row jumps to the top of the table.

      I was able to reproduce the problem without the custom plugin, by pasting an HTML table into the source editor. The problem occurs when there are th elements in the tfoot block.

      The original HTML is being modified in two phases. In the first phase the header row is put into a thead block, and the tfoot row is moved to the top of the table (above thead and tbody). The table still displays fine. The HTML at this point is the final state in Confluence 5.7.5, but is just an interim state in Confluence 5.8.

      In the second phase (which occurs in Confluence 5.8 only), the tfoot block content is moved to a new thead block at the very top of the table, which is then followed by an empty tfoot block, the original thead block, and finally the tbody block. At this point the table is displayed incorrectly, with the total row at the top.

      If the th elements in the tfoot block are changed to td elements, the problem does not occur. If the table is ineligible for sticky headers (eg. in a Documentation Theme space, or no header row, or in a page layout section) then the the problem does not occur.

      I'm attaching:

      • the original HTML
      • the HTML as it appears in that first stage when the footer row is still at the bottom of the table - this is also how it looks after loading finishes in Confluence 5.7.5
      • the HTML as it appears when the page is finished loading in Confluence 5.8.10

      It looks like the sticky headers functionality doesn't allow th elements in tfoot blocks, and moves them into a thead block. I think this is a bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            68877acca947 Wendy Fergusson
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: