From f361b37a1c05e991ceb26fbfd086246f9b276130 Mon Sep 17 00:00:00 2001 From: grubert Date: Sun, 8 Feb 2015 23:51:45 +0000 Subject: [PATCH] patch [120] 0002 tables accept option widths: list of relative widths, 'auto' or 'grid' git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7785 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- HISTORY.txt | 3 +- docutils/parsers/rst/directives/__init__.py | 12 ++ docutils/parsers/rst/directives/tables.py | 61 ++++--- docutils/parsers/rst/states.py | 4 +- .../expected/standalone_rst_pseudoxml.txt | 12 +- .../test_rst/test_directives/test_figures.py | 2 +- .../test_rst/test_directives/test_include.py | 2 +- .../test_rst/test_directives/test_tables.py | 199 +++++++++++++++++++-- test/test_parsers/test_rst/test_east_asian_text.py | 8 +- test/test_parsers/test_rst/test_tables.py | 68 +++---- 10 files changed, 276 insertions(+), 95 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index 0f5f02775..0b2b142bf 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -23,7 +23,8 @@ Changes Since 0.12 * docutils/parsers/rst/directives/tables.py - - non-csv tables accept widths, patch [120] .1 + - patch [120] tables accept option widths: list of relative widths, 'auto' + or 'grid'. Release 0.12 (2014-07-06) ========================= diff --git a/docutils/parsers/rst/directives/__init__.py b/docutils/parsers/rst/directives/__init__.py index ee919dd6f..eaa2d8579 100644 --- a/docutils/parsers/rst/directives/__init__.py +++ b/docutils/parsers/rst/directives/__init__.py @@ -402,3 +402,15 @@ def choice(argument, values): def format_values(values): return '%s, or "%s"' % (', '.join(['"%s"' % s for s in values[:-1]]), values[-1]) + +def value_or(values, other): + """ + The argument can be any of `values` or `argument_type`. + """ + def auto_or_other(argument): + if argument in values: + return argument + else: + return other(argument) + return auto_or_other + diff --git a/docutils/parsers/rst/directives/tables.py b/docutils/parsers/rst/directives/tables.py index 449691eba..970df92c9 100644 --- a/docutils/parsers/rst/directives/tables.py +++ b/docutils/parsers/rst/directives/tables.py @@ -30,7 +30,8 @@ class Table(Directive): final_argument_whitespace = True option_spec = {'class': directives.class_option, 'name': directives.unchanged, - 'widths': directives.positive_int_list} + 'widths': directives.value_or(('auto', 'grid'), + directives.positive_int_list)} has_content = True def make_title(self): @@ -86,21 +87,19 @@ class Table(Directive): self.block_text, self.block_text), line=self.lineno) raise SystemMessagePropagation(error) - def get_column_widths_from_option(self, max_cols): - if 'widths' in self.options: - col_widths = self.options['widths'] - if len(col_widths) != max_cols: + @property + def widths(self): + return self.options.get('widths', 'auto') + + def get_column_widths(self, max_cols): + if type(self.widths) == list: + if len(self.widths) != max_cols: error = self.state_machine.reporter.error( '"%s" widths do not match the number of columns in table ' '(%s).' % (self.name, max_cols), nodes.literal_block( self.block_text, self.block_text), line=self.lineno) raise SystemMessagePropagation(error) - return col_widths - - def get_column_widths(self, max_cols): - col_widths_from_option = self.get_column_widths_from_option(max_cols) - if col_widths_from_option: - col_widths = col_widths_from_option + col_widths = self.widths elif max_cols: col_widths = [100 // max_cols] * max_cols else: @@ -108,7 +107,8 @@ class Table(Directive): 'No table data detected in CSV file.', nodes.literal_block( self.block_text, self.block_text), line=self.lineno) raise SystemMessagePropagation(error) - return col_widths + widths = 'auto' if self.widths == 'auto' else 'given' + return widths, col_widths def extend_short_rows_with_empty_cells(self, columns, parts): for part in parts: @@ -138,12 +138,12 @@ class RSTTable(Table): table_node = node[0] table_node['classes'] += self.options.get('class', []) tgroup = table_node[0] - colspecs = [child for child in tgroup.children - if child.tagname == 'colspec'] - col_widths = self.get_column_widths_from_option(len(colspecs)) - if col_widths: - for colspec, col_width in zip(colspecs, col_widths): + if type(self.widths) == list: + colspecs = [child for child in tgroup.children + if child.tagname == 'colspec'] + for colspec, col_width in zip(colspecs, self.widths): colspec['colwidth'] = col_width + tgroup['colwidths'] = 'auto' if self.widths == 'auto' else 'given' self.add_name(table_node) if title: table_node.insert(0, title) @@ -155,7 +155,8 @@ class CSVTable(Table): option_spec = {'header-rows': directives.nonnegative_int, 'stub-columns': directives.nonnegative_int, 'header': directives.unchanged, - 'widths': directives.positive_int_list, + 'widths': directives.value_or(('auto', ), + directives.positive_int_list), 'file': directives.path, 'url': directives.uri, 'encoding': directives.encoding, @@ -233,7 +234,7 @@ class CSVTable(Table): self.check_table_dimensions(rows, header_rows, stub_columns) table_head.extend(rows[:header_rows]) table_body = rows[header_rows:] - col_widths = self.get_column_widths(max_cols) + widths, col_widths = self.get_column_widths(max_cols) self.extend_short_rows_with_empty_cells(max_cols, (table_head, table_body)) except SystemMessagePropagation, detail: @@ -249,7 +250,7 @@ class CSVTable(Table): return [error] table = (col_widths, table_head, table_body) table_node = self.state.build_table(table, self.content_offset, - stub_columns) + stub_columns, widths=widths) table_node['classes'] += self.options.get('class', []) self.add_name(table_node) if title: @@ -374,7 +375,8 @@ class ListTable(Table): option_spec = {'header-rows': directives.nonnegative_int, 'stub-columns': directives.nonnegative_int, - 'widths': directives.positive_int_list, + 'widths': directives.value_or(('auto', ), + directives.positive_int_list), 'class': directives.class_option, 'name': directives.unchanged} @@ -389,7 +391,7 @@ class ListTable(Table): node = nodes.Element() # anonymous container for parsing self.state.nested_parse(self.content, self.content_offset, node) try: - num_cols, col_widths = self.check_list_content(node) + num_cols, widths, col_widths = self.check_list_content(node) table_data = [[item.children for item in row_list[0]] for row_list in node[0]] header_rows = self.options.get('header-rows', 0) @@ -397,7 +399,7 @@ class ListTable(Table): self.check_table_dimensions(table_data, header_rows, stub_columns) except SystemMessagePropagation, detail: return [detail.args[0]] - table_node = self.build_table_from_list(table_data, col_widths, + table_node = self.build_table_from_list(table_data, widths, col_widths, header_rows, stub_columns) table_node['classes'] += self.options.get('class', []) self.add_name(table_node) @@ -441,15 +443,18 @@ class ListTable(Table): raise SystemMessagePropagation(error) else: num_cols = len(item[0]) - col_widths = self.get_column_widths(num_cols) - return num_cols, col_widths + widths, col_widths = self.get_column_widths(num_cols) + return num_cols, widths, col_widths - def build_table_from_list(self, table_data, col_widths, header_rows, stub_columns): + def build_table_from_list(self, table_data, widths, col_widths, header_rows, + stub_columns): table = nodes.table() - tgroup = nodes.tgroup(cols=len(col_widths)) + tgroup = nodes.tgroup(cols=len(col_widths), colwidths=widths) table += tgroup for col_width in col_widths: - colspec = nodes.colspec(colwidth=col_width) + colspec = nodes.colspec() + if col_width is not None: + colspec.attributes['colwidth'] = col_width if stub_columns: colspec.attributes['stub'] = 1 stub_columns -= 1 diff --git a/docutils/parsers/rst/states.py b/docutils/parsers/rst/states.py index 4619d343e..3d10785c3 100644 --- a/docutils/parsers/rst/states.py +++ b/docutils/parsers/rst/states.py @@ -1747,10 +1747,10 @@ class Body(RSTState): line=startline+offset) return [error] - def build_table(self, tabledata, tableline, stub_columns=0): + def build_table(self, tabledata, tableline, stub_columns=0, widths='auto'): colwidths, headrows, bodyrows = tabledata table = nodes.table() - tgroup = nodes.tgroup(cols=len(colwidths)) + tgroup = nodes.tgroup(cols=len(colwidths), colwidths=widths) table += tgroup for colwidth in colwidths: colspec = nodes.colspec(colwidth=colwidth) diff --git a/test/functional/expected/standalone_rst_pseudoxml.txt b/test/functional/expected/standalone_rst_pseudoxml.txt index 5cbe5e404..1b8183ee3 100644 --- a/test/functional/expected/standalone_rst_pseudoxml.txt +++ b/test/functional/expected/standalone_rst_pseudoxml.txt @@ -1288,7 +1288,7 @@ Plaintext markup syntax and parser system. - + @@ -1558,7 +1558,7 @@ Compound 7, with a table inside:
- + @@ -1768,7 +1768,7 @@ This table has a cell spanning two columns:
- + @@ -1839,7 +1839,7 @@ Here's a table with cells spanning several rows:
- + @@ -1891,7 +1891,7 @@ Here's a complex table, which should test all features.
- + @@ -1978,7 +1978,7 @@
list table with integral header - <tgroup cols="3"> + <tgroup cols="3" colwidths="given"> <colspec colwidth="10" stub="1"> <colspec colwidth="20"> <colspec colwidth="30"> diff --git a/test/test_parsers/test_rst/test_directives/test_figures.py b/test/test_parsers/test_rst/test_directives/test_figures.py index 56544ec3c..c9d3c4cd8 100755 --- a/test/test_parsers/test_rst/test_directives/test_figures.py +++ b/test/test_parsers/test_rst/test_directives/test_figures.py @@ -173,7 +173,7 @@ This figure lacks a caption. It may still have a A picture with a caption and a legend. <legend> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="23"> <colspec colwidth="23"> <thead> diff --git a/test/test_parsers/test_rst/test_directives/test_include.py b/test/test_parsers/test_rst/test_directives/test_include.py index 92f1ce307..d56e0c437 100755 --- a/test/test_parsers/test_rst/test_directives/test_include.py +++ b/test/test_parsers/test_rst/test_directives/test_include.py @@ -531,7 +531,7 @@ Testing errors in included file: section underline too short ----- <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="6"> <thead> diff --git a/test/test_parsers/test_rst/test_directives/test_tables.py b/test/test_parsers/test_rst/test_directives/test_tables.py index 16105dba3..113accdb9 100755 --- a/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/test/test_parsers/test_rst/test_directives/test_tables.py @@ -71,7 +71,7 @@ totest['table'] = [ <table classes="custom" ids="tab-truth-not" names="tab:truth.not"> <title> Truth table for "not" - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="5"> <colspec colwidth="5"> <thead> @@ -109,7 +109,7 @@ totest['table'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="10"> <colspec colwidth="10"> <tbody> @@ -143,7 +143,7 @@ totest['table'] = [ <problematic ids="id2" refid="id1"> * error - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="6"> <colspec colwidth="5"> <tbody> @@ -195,7 +195,7 @@ totest['table'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="given"> <colspec colwidth="15"> <colspec colwidth="25"> <tbody> @@ -218,7 +218,7 @@ totest['table'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="given"> <colspec colwidth="10"> <colspec colwidth="20"> <tbody> @@ -230,6 +230,52 @@ totest['table'] = [ <paragraph> custom widths. """], +["""\ +.. table:: + :widths: auto + + +--------------+-------------------+ + | Columns with | automatic widths. | + +--------------+-------------------+ +""", +"""\ +<document source="test data"> + <table> + <tgroup cols="2" colwidths="auto"> + <colspec colwidth="14"> + <colspec colwidth="19"> + <tbody> + <row> + <entry> + <paragraph> + Columns with + <entry> + <paragraph> + automatic widths. +"""], +["""\ +.. table:: + :widths: grid + + +--------------+-------------------+ + | Columns with | automatic widths. | + +--------------+-------------------+ +""", +"""\ +<document source="test data"> + <table> + <tgroup cols="2" colwidths="given"> + <colspec colwidth="14"> + <colspec colwidth="19"> + <tbody> + <row> + <entry> + <paragraph> + Columns with + <entry> + <paragraph> + automatic widths. +"""], ] totest['csv-table'] = [ @@ -250,7 +296,7 @@ totest['csv-table'] = [ <table> <title> inline with integral header - <tgroup cols="3"> + <tgroup cols="3" colwidths="given"> <colspec colwidth="10" stub="1"> <colspec colwidth="20"> <colspec colwidth="30"> @@ -310,7 +356,7 @@ totest['csv-table'] = [ <table> <title> inline with separate header - <tgroup cols="3"> + <tgroup cols="3" colwidths="given"> <colspec colwidth="10"> <colspec colwidth="20"> <colspec colwidth="30"> @@ -354,7 +400,7 @@ totest['csv-table'] = [ <table> <title> complex internal structure - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -408,7 +454,7 @@ totest['csv-table'] = [ <table> <title> short rows - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -445,7 +491,7 @@ totest['csv-table'] = [ <table> <title> short rows - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -486,7 +532,7 @@ u"""\ <table> <title> non-ASCII characters - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="100"> <tbody> <row> @@ -584,7 +630,7 @@ u"""\ <problematic ids="id2" refid="id1"> * title - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -709,7 +755,7 @@ u"""\ <table> <title> good delimiter - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -727,7 +773,7 @@ u"""\ <table> <title> good delimiter - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -745,7 +791,7 @@ u"""\ <table> <title> good delimiter - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -763,7 +809,7 @@ u"""\ <table> <title> good delimiter - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -870,7 +916,7 @@ u"""\ <table> <title> good encoding - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="33"> <colspec colwidth="33"> <colspec colwidth="33"> @@ -959,7 +1005,7 @@ totest['list-table'] = [ <table> <title> list table with integral header - <tgroup cols="3"> + <tgroup cols="3" colwidths="given"> <colspec colwidth="10" stub="1"> <colspec colwidth="20"> <colspec colwidth="30"> @@ -1008,6 +1054,123 @@ totest['list-table'] = [ On a stick! """], ["""\ +.. list-table:: list table with integral header + :widths: auto + :header-rows: 1 + :stub-columns: 1 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! +""", +"""\ +<document source="test data"> + <table> + <title> + list table with integral header + <tgroup cols="3" colwidths="auto"> + <colspec colwidth="33" stub="1"> + <colspec colwidth="33"> + <colspec colwidth="33"> + <thead> + <row> + <entry> + <paragraph> + Treat + <entry> + <paragraph> + Quantity + <entry> + <paragraph> + Description + <tbody> + <row> + <entry> + <paragraph> + Albatross + <entry> + <paragraph> + 2.99 + <entry> + <paragraph> + On a stick! +"""], +["""\ +.. list-table:: list table with integral header + :header-rows: 1 + :stub-columns: 1 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn\'t be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +""", +"""\ +<document source="test data"> + <table> + <title> + list table with integral header + <tgroup cols="3" colwidths="auto"> + <colspec colwidth="33" stub="1"> + <colspec colwidth="33"> + <colspec colwidth="33"> + <thead> + <row> + <entry> + <paragraph> + Treat + <entry> + <paragraph> + Quantity + <entry> + <paragraph> + Description + <tbody> + <row> + <entry> + <paragraph> + Albatross + <entry> + <paragraph> + 2.99 + <entry> + <paragraph> + On a stick! + <row> + <entry> + <paragraph> + Crunchy Frog + <entry> + <paragraph> + 1.49 + <entry> + <paragraph> + If we took the bones out, it wouldn\'t be + crunchy, now would it? + <row> + <entry> + <paragraph> + Gannet Ripple + <entry> + <paragraph> + 1.99 + <entry> + <paragraph> + On a stick! +"""], +["""\ .. list-table:: not a bullet list diff --git a/test/test_parsers/test_rst/test_east_asian_text.py b/test/test_parsers/test_rst/test_east_asian_text.py index 953bfbaa7..76565edc9 100755 --- a/test/test_parsers/test_rst/test_east_asian_text.py +++ b/test/test_parsers/test_rst/test_east_asian_text.py @@ -65,7 +65,7 @@ u"""\ u"""\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="23"> <tbody> <row> @@ -99,7 +99,7 @@ u"""\ <paragraph> Complex spanning pattern (no edge knows all rows/cols): <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="8"> <colspec colwidth="14"> <colspec colwidth="6"> @@ -138,7 +138,7 @@ u"""\ u"""\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="9"> <colspec colwidth="9"> <tbody> @@ -186,7 +186,7 @@ b("""\ <paragraph> Some ambiguous-width characters: <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="1"> <colspec colwidth="35"> <tbody> diff --git a/test/test_parsers/test_rst/test_tables.py b/test/test_parsers/test_rst/test_tables.py index 1df34053b..fd7c12f19 100755 --- a/test/test_parsers/test_rst/test_tables.py +++ b/test/test_parsers/test_rst/test_tables.py @@ -30,7 +30,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="37"> <tbody> <row> @@ -47,7 +47,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="23"> <tbody> <row> @@ -83,7 +83,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="24"> <tbody> <row> @@ -91,7 +91,7 @@ totest['grid_tables'] = [ <paragraph> A well-formed | table. <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="24"> <tbody> <row> @@ -107,7 +107,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="14"> <tbody> @@ -129,7 +129,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="14"> <tbody> <row> @@ -151,7 +151,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="13"> <tbody> @@ -180,7 +180,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="15"> <tbody> @@ -209,7 +209,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="13"> <tbody> @@ -240,7 +240,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="14"> <tbody> @@ -268,7 +268,7 @@ totest['grid_tables'] = [ """\ <document source="test data"> <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="13"> <colspec colwidth="15"> @@ -308,7 +308,7 @@ Complex spanning pattern (no edge knows all rows/cols): <paragraph> Complex spanning pattern (no edge knows all rows/cols): <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="11"> <colspec colwidth="13"> <colspec colwidth="11"> @@ -348,7 +348,7 @@ Complex spanning pattern (no edge knows all rows/cols): """\ <document source="test data"> <table> - <tgroup cols="4"> + <tgroup cols="4" colwidths="auto"> <colspec colwidth="24"> <colspec colwidth="12"> <colspec colwidth="10"> @@ -423,7 +423,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="17"> <colspec colwidth="8"> <tbody> @@ -458,7 +458,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="17"> <colspec colwidth="8"> <tbody> @@ -518,7 +518,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="30"> <tbody> <row> @@ -526,7 +526,7 @@ No blank line after table. <paragraph> This table contains another. <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="25"> <tbody> <row> @@ -544,7 +544,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="18"> <colspec colwidth="8"> <tbody> @@ -572,7 +572,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="78"> <tbody> <row> @@ -609,7 +609,7 @@ And more. <paragraph> Something before. <table> - <tgroup cols="1"> + <tgroup cols="1" colwidths="auto"> <colspec colwidth="78"> <tbody> <row> @@ -640,7 +640,7 @@ Paragraph. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="12"> <tbody> @@ -663,7 +663,7 @@ and two rows. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="12"> <tbody> @@ -691,7 +691,7 @@ two rows, and a column span. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="14"> <tbody> @@ -723,7 +723,7 @@ two rows, and a column span. """\ <document source="test data"> <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="2"> <colspec colwidth="11"> <colspec colwidth="44"> @@ -774,7 +774,7 @@ A table with three columns. """\ <document source="test data"> <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="7"> <colspec colwidth="9"> <colspec colwidth="8"> @@ -838,7 +838,7 @@ No blank line after table. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="6"> <thead> @@ -939,7 +939,7 @@ cell 3 cell 4 """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="2"> <colspec colwidth="28"> <tbody> @@ -956,7 +956,7 @@ cell 3 cell 4 2 <entry> <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="7"> <colspec colwidth="6"> <colspec colwidth="8"> @@ -985,7 +985,7 @@ with empty cells """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="16"> <colspec colwidth="6"> <tbody> @@ -1011,7 +1011,7 @@ with empty cells """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="14"> <colspec colwidth="8"> <thead> @@ -1067,7 +1067,7 @@ Blank line after. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="17"> <tbody> @@ -1112,7 +1112,7 @@ A table with many row separators. """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="12"> <colspec colwidth="20"> <tbody> @@ -1183,7 +1183,7 @@ A table with many row separators. 3 no spans here == =========== =========== <table> - <tgroup cols="3"> + <tgroup cols="3" colwidths="auto"> <colspec colwidth="2"> <colspec colwidth="11"> <colspec colwidth="11"> @@ -1225,7 +1225,7 @@ Note The first row of this table may expand """\ <document source="test data"> <table> - <tgroup cols="2"> + <tgroup cols="2" colwidths="auto"> <colspec colwidth="9"> <colspec colwidth="69"> <tbody> -- 2.11.4.GIT