renderInTable() is called to render FITS images in a table

def renderInTable(self, relpath=""):
        """renderInTable() is called to render FITS images in a table"""
        # return from cache if available
        cachekey, html = self.checkCache('InTable', relpath)
        if html is not None:
            return html
        # else regenerate
        # single image: render as standard cells
        if len(self.imgrec) == 1:
            rec = self.imgrec[0]
            # add header
            html = "    <TR><TD COLSPAN=2>"
            html += self.renderLinkComment(relpath) or ""
            html += "</TD></TR>\n"
            html_img, comment = self._renderImageRec(rec, relpath, include_size=True)
            html += "\n".join([
                "    <TR>",
                "      <TD>%s</TD>" % html_img,
                "      <TD>%s</TD>" % comment,
                "    </TR>\n"])
        # multiple images: render a single header row, followed by one row per image
        else:
            # add header
            html = "    <TR><TD COLSPAN=2>"
            html += self.renderLinkComment(relpath)
            # append information on image and end the table row
            html += "\n      <DIV ALIGN=right><P>%s FITS cube, %d planes are given below.</P></DIV></TD></TR>\n" % (
            self.cubesize, len(self.imgrec))
            # now loop over images and generate a table row for each
            for irec, rec in enumerate(self.imgrec):
                html_img, comment = self._renderImageRec(rec, relpath)
                comment = "<P>Image plane #%d.</P>%s" % (irec, comment)
                html += "\n".join([
                    "    <TR>",
                    "      <TD>%s</TD>" % html_img,
                    "      <TD>%s</TD>" % comment,
                    "    </TR>\n"])
        return self.writeCache(cachekey, html)