From bf6cf6276a5cb6a9b2d8c5f88017899a52edacbd Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 7 Nov 2019 21:56:36 +0100 Subject: Page-break fixes for HTML format, headers removed from HTML since very unreliable anyway --- dealconvert/formats/html.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/dealconvert/formats/html.py b/dealconvert/formats/html.py index 758c0fc..244b6f2 100644 --- a/dealconvert/formats/html.py +++ b/dealconvert/formats/html.py @@ -26,33 +26,31 @@ _page_template = ''' table { border-collapse: collapse; table-layout: fixed; - page-break-inside:auto; + page-break-inside:avoid; font-size: 8pt; + font-family: Arial, "Sans-serif"; } @media screen { table { font-size: 12px; } + thead { + display: table-header-group; + } } tr { page-break-inside:avoid; page-break-after:auto; } td { + page-break-inside:avoid; overflow: visible; + padding-bottom: 0; } thead { font-size: 10pt; -} -.header-left { text-align: left; -} -.header-right { - text-align: right; -} -.header-right:after { - counter-increment: page; - content: counter(page); + display: none; } .suit-d, .suit-h { color: red; @@ -63,14 +61,11 @@ thead { - - + - -%s -
%sPage %s
+%s ''' @@ -81,7 +76,8 @@ class HTMLFormat(DealFormat): return '.html' def __init__(self, *args, **kwargs): - self.deals_per_column = kwargs.get('columns', 6) or 6 + DealFormat.__init__(self, *args, **kwargs) + self.deals_per_column = self.options.get('columns', 6) or 6 def parse_content(self, content): raise NotImplementedError @@ -190,9 +186,9 @@ class HTMLFormat(DealFormat): dealset = dealset[self.deals_per_column:] table_content = '' for row in deal_rows: - table_content += '' + table_content += '' for deal in row: - table_content += '
' + table_content += '' deal_cells = [ ['', '', '', ''], ['', '', '', ''], @@ -219,9 +215,9 @@ class HTMLFormat(DealFormat): deal_content += '
' table_content += deal_content table_content += '' - table_content += '' + table_content += '' return _page_template % ( - self.deals_per_column - 1, event_name, table_content + self.deals_per_column, event_name, table_content ) def output_content(self, out_file, dealset): -- cgit v1.2.3