The attached patch modifies the LaTeX and XeLaTeX writers so that any classes on a table that are not listed in docutils.writers.latex2e.Writer.table_style_values (i.e., any classes that docutils does not already assign a meaning to) are converted to DUclass environments around the table in the output. With this patch, an input of:
.. table::
:class: my-class colwidths-auto
=== ======
Foo Bar
=== ======
Red Blue
Qux Glarch
=== ======
would be converted by rst2latex.py to a document containing:
\begin{DUclass}{my-class}
% normal markup for colwidths-auto table goes here
\end{DUclass}
Note that I made the minimum changes necessary to implement this patch while disrupting as little of the pre-existing tests as possible. You may want to fiddle with the patch some to adjust the whitespace around the output \begin{DUclass} commands.
I ended up fiddling with the whitespace myself. Attached is a modified patch with more reasonable spacing around the
\begin{DUclass}.Applied in r8569.
Thank you for the patch.
Fixed in Docutils 0.17.
Thanks again for your contribution.