From: Günter M. <mi...@us...> - 2022-02-11 10:25:07
|
Thank you for the report. Unless the problem is fixed, there is a workaround: Tables works fine with Docutils 0.18.1 and `rst2html5.py` "out of the box", because of the new default (colwidths-auto). https://docutils.sourceforge.io/RELEASE-NOTES.html#release-0-18-2021-10-26 With "html4css1" and "latex", you can use the config setting `table-style: colwidths-auto` or command line option `--table-style=colwidth-auto` (for the complete document) or ``:widths: auto`` on individual tables. This should also work for Docutils 0.17. Compare: ~~~ .. table:: :width: 100% :widths: auto === === === === === === === === x x x x x x x x === === === === === === === === .. table:: :width: 100% :widths: grid === === === === === === === === x x x x x x x x === === === === === === === === ~~~ --- ** [bugs:#444] Table column width rounding can result in uneven column widths** **Status:** open **Created:** Thu Feb 10, 2022 06:13 AM UTC by Alex Forencich **Last Updated:** Thu Feb 10, 2022 06:18 AM UTC **Owner:** nobody In the HTML generated for a table with 8 equal-width columns, the column widths in the generated colgroups are all rounded up from 12.5% to 13%, resulting in the last column being much too narrow (0.5 * 7 = 3.5, 3.5/12.5 = 0.28, so the accumulated error is almost 30%). The fix would be to revise the rounding in `depart_colspec` in `_html_base.py` to produce at least one decimal place, instead of rounding to the nearest integer. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |