diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2017-10-19 16:21:27 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2017-10-19 16:21:27 +0000 |
| commit | 457192bad92591e965f0ebf8918a4fac9a350998 (patch) | |
| tree | 1fdf9baaa048394f30ce990df0cb2656ba018d75 /docutils/test/functional/expected | |
| parent | bd01d371fde791254e1bc54a0408c4baf50a9a58 (diff) | |
| download | docutils-457192bad92591e965f0ebf8918a4fac9a350998.tar.gz | |
Fix :width: option for the table directives.
* add table width argument in docutils.dtd
* support table width argument in html and latex writers
* fix support in "csv-table" directive
* add test cases.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8187 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/functional/expected')
6 files changed, 156 insertions, 20 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_docutils_xml.xml b/docutils/test/functional/expected/standalone_rst_docutils_xml.xml index 2866caf5e..3d33fc95f 100644 --- a/docutils/test/functional/expected/standalone_rst_docutils_xml.xml +++ b/docutils/test/functional/expected/standalone_rst_docutils_xml.xml @@ -1605,7 +1605,7 @@ Comments may contain non-ASCII characters: ä ö ü æ ø å</comment> <section ids="list-tables" names="list\ tables"> <title auto="1" refid="id72"><generated classes="sectnum">2.22 </generated>List Tables</title> <paragraph>Here's a list table exercising all features:</paragraph> - <table classes="colwidths-given test"> + <table classes="colwidths-given test" width="40em"> <title>list table with integral header</title> <tgroup cols="3"> <colspec colwidth="10" stub="1"></colspec> @@ -1662,7 +1662,7 @@ Comments may contain non-ASCII characters: ä ö ü æ ø å</comment> </tbody> </tgroup> </table> - <table align="center"> + <table align="center" classes="colwidths-auto"> <title>center aligned list table</title> <tgroup cols="2"> <colspec colwidth="50"></colspec> diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html index cb660a8f5..4d66cff28 100644 --- a/docutils/test/functional/expected/standalone_rst_html4css1.html +++ b/docutils/test/functional/expected/standalone_rst_html4css1.html @@ -1169,7 +1169,7 @@ empty: <tt class="docutils literal"><span class="pre">--></span></tt></td> <div class="section" id="list-tables"> <h2><a class="toc-backref" href="#id72">2.22 List Tables</a></h2> <p>Here's a list table exercising all features:</p> -<table border="1" class="colwidths-given test docutils"> +<table border="1" class="colwidths-given test docutils" style="width: 40em"> <caption>list table with integral header</caption> <colgroup> <col width="17%" /> @@ -1198,12 +1198,8 @@ crunchy, now would it?</td> </tr> </tbody> </table> -<table border="1" class="docutils align-center"> +<table border="1" class="colwidths-auto docutils align-center"> <caption>center aligned list table</caption> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> <tbody valign="top"> <tr><td>Albatross</td> <td>2.99</td> diff --git a/docutils/test/functional/expected/standalone_rst_html5.html b/docutils/test/functional/expected/standalone_rst_html5.html index fa255f41d..2419ab67f 100644 --- a/docutils/test/functional/expected/standalone_rst_html5.html +++ b/docutils/test/functional/expected/standalone_rst_html5.html @@ -1139,7 +1139,7 @@ empty: <span class="docutils literal"><span class="pre">--></span></span></p> <div class="section" id="list-tables"> <h2><a class="toc-backref" href="#id76"><span class="sectnum">2.22</span> List Tables</a></h2> <p>Here's a list table exercising all features:</p> -<table class="colwidths-given test"> +<table class="colwidths-given test" style="width: 40em"> <caption>list table with integral header</caption> <colgroup> <col style="width: 17%" /> @@ -1168,12 +1168,8 @@ crunchy, now would it?</p></td> </tr> </tbody> </table> -<table class="align-center"> +<table class="colwidths-auto align-center"> <caption>center aligned list table</caption> -<colgroup> -<col style="width: 50%" /> -<col style="width: 50%" /> -</colgroup> <tbody> <tr><td><p>Albatross</p></td> <td><p>2.99</p></td> diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex index 33e5630d2..b35b5f04f 100644 --- a/docutils/test/functional/expected/standalone_rst_latex.tex +++ b/docutils/test/functional/expected/standalone_rst_latex.tex @@ -1671,7 +1671,79 @@ body row 3 \end{longtable*} -\subsection{2.21 Custom Roles% +\subsection{2.21 List Tables% + \label{list-tables}% +} + +Here’s a list table exercising all features: + +\setlength{\DUtablewidth}{40em} +\begin{longtable}[c]{|p{0.133\DUtablewidth}|p{0.249\DUtablewidth}|p{0.365\DUtablewidth}|} +\caption{list table with integral header}\\ +\hline +\textbf{% +Treat +} & \textbf{% +Quantity +} & \textbf{% +Description +} \\ +\hline +\endfirsthead +\caption[]{list table with integral header (... continued)}\\ +\hline +\textbf{% +Treat +} & \textbf{% +Quantity +} & \textbf{% +Description +} \\ +\hline +\endhead +\multicolumn{3}{c}{\hfill ... continued on next page} \\ +\endfoot +\endlastfoot +\textbf{% +Albatross +} & +2.99 + & +On a stick! + \\ +\hline +\textbf{% +Crunchy Frog +} & +1.49 + & +If we took the bones out, it wouldn’t be +crunchy, now would it? + \\ +\hline +\textbf{% +Gannet Ripple +} & +1.99 + & +On a stick! + \\ +\hline +\end{longtable} + +\begin{longtable}[c]{|l|l|} +\caption{center aligned list table}\\ +\hline +Albatross & 2.99 \\ +\hline +Crunchy Frog & 1.49 \\ +\hline +Gannet Ripple & 1.99 \\ +\hline +\end{longtable} + + +\subsection{2.22 Custom Roles% \label{custom-roles}% } @@ -1715,7 +1787,7 @@ The following works in most browsers but does not validate \end{itemize} -\subsection{2.22 Mathematics% +\subsection{2.23 Mathematics% \label{mathematics}% } diff --git a/docutils/test/functional/expected/standalone_rst_pseudoxml.txt b/docutils/test/functional/expected/standalone_rst_pseudoxml.txt index 05729143a..4703f481c 100644 --- a/docutils/test/functional/expected/standalone_rst_pseudoxml.txt +++ b/docutils/test/functional/expected/standalone_rst_pseudoxml.txt @@ -2211,7 +2211,7 @@ List Tables <paragraph> Here's a list table exercising all features: - <table classes="colwidths-given test"> + <table classes="colwidths-given test" width="40em"> <title> list table with integral header <tgroup cols="3"> @@ -2261,7 +2261,7 @@ <entry> <paragraph> On a stick! - <table align="center"> + <table align="center" classes="colwidths-auto"> <title> center aligned list table <tgroup cols="2"> diff --git a/docutils/test/functional/expected/standalone_rst_xetex.tex b/docutils/test/functional/expected/standalone_rst_xetex.tex index c592aa618..3f8e9f1b6 100644 --- a/docutils/test/functional/expected/standalone_rst_xetex.tex +++ b/docutils/test/functional/expected/standalone_rst_xetex.tex @@ -1677,7 +1677,79 @@ body row 3 \end{longtable*} -\subsection{2.21 Custom Roles% +\subsection{2.21 List Tables% + \label{list-tables}% +} + +Here’s a list table exercising all features: + +\setlength{\DUtablewidth}{40em} +\begin{longtable}[c]{|p{0.133\DUtablewidth}|p{0.249\DUtablewidth}|p{0.365\DUtablewidth}|} +\caption{list table with integral header}\\ +\hline +\textbf{% +Treat +} & \textbf{% +Quantity +} & \textbf{% +Description +} \\ +\hline +\endfirsthead +\caption[]{list table with integral header (... continued)}\\ +\hline +\textbf{% +Treat +} & \textbf{% +Quantity +} & \textbf{% +Description +} \\ +\hline +\endhead +\multicolumn{3}{c}{\hfill ... continued on next page} \\ +\endfoot +\endlastfoot +\textbf{% +Albatross +} & +2.99 + & +On a stick! + \\ +\hline +\textbf{% +Crunchy Frog +} & +1.49 + & +If we took the bones out, it wouldn’t be +crunchy, now would it? + \\ +\hline +\textbf{% +Gannet Ripple +} & +1.99 + & +On a stick! + \\ +\hline +\end{longtable} + +\begin{longtable}[c]{|l|l|} +\caption{center aligned list table}\\ +\hline +Albatross & 2.99 \\ +\hline +Crunchy Frog & 1.49 \\ +\hline +Gannet Ripple & 1.99 \\ +\hline +\end{longtable} + + +\subsection{2.22 Custom Roles% \label{custom-roles}% } @@ -1721,7 +1793,7 @@ The following works in most browsers but does not validate \end{itemize} -\subsection{2.22 Mathematics% +\subsection{2.23 Mathematics% \label{mathematics}% } |
