def as_html(self, max_rows=<NUM_LIT:0>):
if not max_rows or max_rows > self.num_rows:<EOL><INDENT>max_rows = self.num_rows<EOL><DEDENT>omitted = max(<NUM_LIT:0>, self.num_rows - max_rows)<EOL>labels = self.labels<EOL>lines = [<EOL>(<NUM_LIT:0>, '<STR_LIT>'),<EOL>(<NUM_LIT:1>, '<STR_LIT>'),<EOL>(<NUM_LIT:2>, '<STR_LIT>'),<EOL>(<NUM_LIT:3>, '<STR_LIT:U+0020>'.join('<STR_LIT>' + label + '<STR_LIT>' for label in labels)),<EOL>(<NUM_LIT:2>, '<STR_LIT>'),<EOL>(<NUM_LIT:1>, '<STR_LIT>'),<EOL>(<NUM_LIT:1>, '<STR_LIT>'),<EOL>]<EOL>fmts = self._get_column_formatters(max_rows, True)<EOL>for row in itertools.islice(self.rows, max_rows):<EOL><INDENT>lines += [<EOL>(<NUM_LIT:2>, '<STR_LIT>'),<EOL>(<NUM_LIT:3>, '<STR_LIT:U+0020>'.join('<STR_LIT>' + fmt(v, label=False) + '<STR_LIT>' for<EOL>v, fmt in zip(row, fmts))),<EOL>(<NUM_LIT:2>, '<STR_LIT>'),<EOL>]<EOL><DEDENT>lines.append((<NUM_LIT:1>, '<STR_LIT>'))<EOL>lines.append((<NUM_LIT:0>, '<STR_LIT>'))<EOL>if omitted:<EOL><INDENT>lines.append((<NUM_LIT:0>, '<STR_LIT>'.format(omitted)))<EOL><DEDENT>return '<STR_LIT:\n>'.join(<NUM_LIT:4> * indent * '<STR_LIT:U+0020>' + text for indent, text in lines)<EOL>
Format table as HTML.