def markdown_table(body, header=None):
    """ Generate a MultiMarkdown text table.
        :param body:    The body as a list-of-lists
        :param header:  The header to print
    """
    s = ""
    def cellstr(cell):
        if type(cell) == float:
            return ("%.2f" % cell)
        if type(cell) in (list, tuple):
            return ', '.join(cellstr(e) for e in cell)
        return str(cell)
    
    def makerow(row):
        rowstrs = [cellstr(cell).rjust(maxlen[i]) for i,cell in enumerate(row)]
        return '| ' + ' | '.join(rowstrs) + ' |\n'
    
    if header:
        body = [header] + body
    maxlen = [max(len(cellstr(cell)) for cell in col) for col in zip(*body)]
    if header:
        s += makerow(body[0])
        s += '|'+'|'.join('-'*(m+2) for m in maxlen)+'|\n'
        body = body[1:]
    for row in body:
        s += makerow(row)
    return s