Currently humans need to specify the column width for tables to make them look good in output whenever they put data into a Docbook table. These humans should be replaced by robots. It would be great if code could compute the width needed to set the table columns to the right size. table-layout: auto in css does it; but it allows tables bigger than the page width to overflow the page. Also, it requires column width specification to be absent (currently table column widths are inserted by Publican). So an algorithm that computes the right column width, or some magical css that does it would be nice - and more reliable than human intervention.
According to the Internet there is no way to use CSS on tables to force a max-width and allow columns to choose better sizes. Since we can not allow tables to break the page width, this rules out CSS magic. Calculating the smartest width for columns would require post processing the HTML, as the docbook is not tightly coupled to the output sizing. This is a PHD endeavour and not achievable in release time frames. (patches accepted!) What I have done is stop publican from adding any widths when no widths are set in the source, this may aid layout for some content. To ssh://git.fedorahosted.org/git/publican.git 7b464d2..725d2e6 devel -> devel
Needinfo Jeff Hi Jeff, how would one test this? I created a table without any <col width="foo%"/> specified, and publican then creates a table with columns sized to fit the table proportionately, e.g. in halves with 2 cols, in thirds with 3 cols. Is that sufficient to test what you changed here? Thanks
(In reply to Bruce Reeler from comment #2) > Needinfo Jeff > Hi Jeff, how would one test this? > > I created a table without any <col width="foo%"/> specified, and publican > then creates a table with columns sized to fit the table proportionately, > e.g. in halves with 2 cols, in thirds with 3 cols. > > Is that sufficient to test what you changed here? > Thanks You need to check the HTML source to make sure there is no colwidth setting in the generated table.
Verified that not including a 'width' attribute to <col>s will result in no <col width=X%/> tags in the resulting HTML. Including <col width=X%> in the XML source will still result in those same settings applied in the HTML as expected. Tested on common-db5 brand.
A fix for this shipped in Publican 4.2.0.