from random import choice from string import digits, ascii_letters def makeTable(headerAndDataList, rows, tableId="table"): def cellString(cell): cell = str(cell) if cell == "[]": return "None" excludeChars = """<>"'[]""" for c in excludeChars: if c in cell: cell = cell.replace(c, "") return cell def td(cell): return '
''' for i in headerAndDataList: table += th(i[0]) table += ''' |
---|
' for i in headerAndDataList: table += td(eval(i[1])) table += ' |