0

我正在生成一个<table>并使用<cfdocument>. 我想在新页面运行时包含表头。这大约是每 30 行。

这是我当前的代码。应该在<cfif>每个新行处强制中断。然而,它似乎所做的只是创建了 4 个空白页,内容位于底部,格式与以前相同

<cfloop query="One">

    <cfif not(One.currentrow MOD 30)>
        <cfdocumentitem type="pagebreak" />
        <th>Contact Name</th>
     </cfif>

     <cfoutput> 
        #One.contactName# 
     </cfoutput>
4

2 回答 2

1

Fixed. Here is what I used to get my header on every page. Further note, if you need to adjust the document header size, then include margintop="2.2" in your main tag and adjust to taste.

 <cfdocumentitem type="header" evalAtPrint="true" > 
        <td>Contact Name</td>
 </cfdocumentitem>
于 2013-02-19T16:06:55.057 回答
0

试试这个:这是我得到的解决方案。

<cfloop query="get_list">

<!---7 row each page--->
<cfset mode = get_list.currentrow mod 7>


<cfif mode eq 1>

<thead>
<tr>
<td>table header</td>
</tr>
</thead>

</cfif>

<tbody>

<tr>
<td>data loop here</td>
</tr>

<tr>
<td>
<cfif mode eq 0>
<cfdocumentitem type="pagebreak">
</cfdocumentitem>
</cfif>
</td>
</tr>

</tbody>
</cfloop>

</table>
于 2013-10-30T09:30:59.287 回答