def render(self): join = os.linesep.join templ = '''\ %s <table id="%s" border="%s" summary="%s"> %%s </table>''' % (self.css, self.name, self.border, self.summary) head, tail = headtail(self) # post-processed head and tail h = '<thead>\n%s\n</thead>\n' % join(head) b = '<tbody>\n%s\n</tbody>\n' % join(join(r) for r in tail) return templ % (h+b)
def __init__(self, header_plus_body): self.header, self.body = headtail(header_plus_body)