Forum Bugs

Multiple issues with automatic table layout

jeric
Hi,

In an effort to make our reports more readable we have upgraded our own reporting software to generate <col> and <colgroup> tags for each table. This way we have more control over the table layout (like specifying 0* for the smallest width possible etc). While this works great in browsers, it gives us some problems in prince.

We have grouped a few test cases in the following html and pdf documents (please ignore the first test case .. this only goes wrong in prince 5.1)

Note: we still use automatic table layout. I realize that fixed table layout gives more predictable results but for now it doesn't work with our tables since the first row contains a lot cells which span multiple columns.

http://eric.nitrate.nl/prince/test_table_layout.html
http://eric.nitrate.nl/prince/test_table_layout.pdf

For the span attributes and colgroup we have workarounds (just generate a col statement with a width attribute for each column).
For the minimal width specifier "0*" we have no workaround (maybe specifying width=0, but this doesn't cause wrapping in prince 5.1 and in prince 6 it causes havoc to all columns after it).

Kind regards,

Eric de Ruiter
Amplixs Interaction Management
mikeday
[reposting, as earlier post was eaten]

Thanks for the detailed table test cases, I've added these issues to the roadmap and we will work to correct them in a future release.
jeric
We also found a workaround for the width="0*" issue: we now give the column a width of 10 pixels. Furthermore we automagically replace every space by a non-breaking space (white-space: nowrap didn't work ..). This simulates the width=0* perfectly.

PS: I was unable to find a reference in the roadmap for this problem.
mikeday
Would you be able to email me a sample document where nowrap doesn't work? It's supposed to work, so if you've found a bug in it we would definitely like to fix it.

There is a rather uninformative reference in the roadmap to "Fix several issues affecting automatic table layout." :)
jeric
The most simple test case I could come up with is this one:

<table border=1>
  <colgroup>
    <col width="auto"></col>
    <col width="10"></col>
  </colgroup>
  <colgroup>
    <col width="50"></col>
    <col width="50"></col>
    <col width="50"></col>
    <col width="50"></col>
  </colgroup>
  <thead>
    <tr>
      <th colspan="2">&nbsp;</th>
      <th>a</th>
      <th>b</th>
      <th>c</th>
      <th>d</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th rowspan="3" nowrap="nowrap">Level 1: A</th>  
      <th nowrap="nowrap">Level 2: A</th>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <th nowrap="nowrap">Level 2: B</th>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <th nowrap="nowrap">Level 2: C</th>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
  </tbody>
</table>
mikeday
Ah, I see that we don't support the "nowrap" attribute on table cells. However, we do support this as a value for the CSS white-space property, which you can access like this:
td[nowrap], th[nowrap] { white-space: nowrap }

We will add this rule to the default XHTML style sheets for the next maintenance release.
mikeday
Today we have released Prince 6.0 rev 5, which supports the nowrap attribute on table cells.