MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / HTMLTableFormatter

Class HTMLTableFormatter

Solutions/6_7/tableformat.py:41–55  ·  view source on GitHub ↗

Output data in HTML format.

Source from the content-addressed store, hash-verified

39 print(','.join(rowdata))
40
41class HTMLTableFormatter(TableFormatter):
42 '''
43 Output data in HTML format.
44 '''
45 def headings(self, headers):
46 print('<tr>', end='')
47 for h in headers:
48 print(f'<th>{h}</th>', end='')
49 print('</tr>')
50
51 def row(self, rowdata):
52 print('<tr>', end='')
53 for d in rowdata:
54 print(f'<td>{d}</td>', end='')
55 print('</tr>')
56
57class FormatError(Exception):
58 pass

Callers 1

create_formatterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected