Initial commit
This commit is contained in:
16
Solutions/9_4/structly/tableformat/formats/html.py
Normal file
16
Solutions/9_4/structly/tableformat/formats/html.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# html.py
|
||||
|
||||
from ..formatter import TableFormatter
|
||||
|
||||
class HTMLTableFormatter(TableFormatter):
|
||||
def headings(self, headers):
|
||||
print('<tr>', end=' ')
|
||||
for h in headers:
|
||||
print('<th>%s</th>' % h, end=' ')
|
||||
print('</tr>')
|
||||
|
||||
def row(self, rowdata):
|
||||
print('<tr>', end=' ')
|
||||
for d in rowdata:
|
||||
print('<td>%s</td>' % d, end=' ')
|
||||
print('</tr>')
|
||||
Reference in New Issue
Block a user