6

我找不到任何选项,这将colspan允许tdrml. 这有可能吗?

4

2 回答 2

8

戈登对blockSpan元素的建议对我有用。以下是如何使用它的示例:

<?xml version="1.0"?>
<document filename="test.pdf">
  <template pageSize="(612,792)" title="Test" author="Don Kirkby">
    <pageTemplate id="first">
      <frame id="first" x1="10.0" y1="10.0" width="592" height="772"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="main">
      <blockSpan start="0,1" stop="1,1"/>
    </blockTableStyle>
  </stylesheet>
  <images/>
  <story>
    <blockTable colWidths="100.0,287.5,187.5" style="main">
      <tr>
        <td><para>Cell 0,0</para></td>
        <td><para>Cell 1,0</para></td>
        <td><para>Cell 2,0</para></td>
      </tr>
      <tr>
        <td><para>Cell 0,1 will flow into its neighbour</para></td>
        <td><para>Cell 1,1 will not appear, but must be present</para></td>
        <td><para>Cell 2,1</para></td>
      </tr>
      <tr>
        <td><para>Cell 0,2</para></td>
        <td><para>Cell 1,2</para></td>
        <td><para>Cell 2,2</para></td>
      </tr>
    </blockTable>
  </story>
</document>
于 2011-12-02T19:39:32.393 回答
3

正常的 ReportLab 方法是使用 Platypus 和Tableflowable。当您设置 的样式时Table,您可以指定'SPAN'将任何矩形单元格区域捆绑为一个的命令。您可以在ReportLab 用户指南,第 7 章,第 81 页中找到更多信息。

如果您必须使用 RML,我倾向于认为 colspan 根本不可用。至少ReportLab RML 参考文档中没有。相反,我认为你应该使用blockSpan元素。没有给出示例,但您可以在RML 手册中找到它。

于 2011-02-16T12:43:31.930 回答