-2

很抱歉我是个新手,因为我以前没有真正尝试过。如果之前已经回答过,请您提供链接以便我查看它吗?这几乎是我想要完成的事情:

在此处输入图像描述

我尝试将它显示在行中,希望它会彼此并排显示,例如 Item 1 | 项目 2 | 项目 3| 但这是不行的。我几乎将销售订单记录或交易记录中的项目列表显示到记录类型的高级 PDF 布局中。

如果有人能提供帮助,谢谢。这是代码块。我正在尝试显示图像显示的项目:

<body padding="8mm 13mm 8mm 13mm" size="A4">
<#if record.item?has_content>
<table class="itemTable" width="100%"><!-- start items --><#list record.item 
as item><#if item_index==0>
<thead>
<tr>
<th colspan="6"  class="itemHeader"      align="left" padding-    
bottom="8px">Code</th>
<th colspan="6"  class="itemHeader"  align="left" padding-bottom="8px" 
padding-left="10px">Qty</th>
<th colspan="6"  class="itemHeader"      align="left" padding- 
bottom="8px">Units</th>
<th colspan="18" class="itemHeader"  align="left" padding-bottom="8px" 
padding-left="15px">Product Description</th>
<th colspan="8"  class="itemHeader"  align="left" padding-bottom="8px">Unit 
Price</th>
<th colspan="8"  class="itemHeaderEnd" align="left" padding-bottom="8px" 
padding-left="10px">Amount</th>
</tr>
</thead>
<!-- Print items -->
</#if><tr>
<td colspan="6"  class="itemDetail"     align="left"><@printCode item.item 
/></td>
<td colspan="6"  class="itemDetail"     align="left" padding- 
left="20px">${item.quantity}</td>
<td colspan="6"  class="itemDetail"     align="center">${item.units}</td>
<td colspan="18" class="itemDetail"     align="left" letter-spacing= "0px" 
padding-left="15px" padding-right="50px">${item.description}</td>
<td colspan="8"  class="itemDetail"     align="left"  padding-left="20px"> 
<#if item.rate?is_number>${item.rate?string("#,##0.00")}<#else>${item.rate} 
</#if></td>
<td colspan="8"  class="itemDetailEnd"  align="left"  padding-left="30px"> 
<#if item.amount?is_number>${item.amount?string("#,##0.00")} 
<#else>${item.amount}</#if></td>
</tr>
</#list><!-- end items --></table>
</#if>

我知道上面从上到下显示了默认外观的项目,我想要实现的是让它从左到右显示。

先感谢您。

-乔

4

1 回答 1

1

在 BFO 中执行此操作的方法是使用内置块的表。然后用缺失的单元格填充最后一行。

例如忽略标题

<#list record.item?chunk(3) as row>
  <tr>
  <#list row as item>... </#list>
  <#if row?size lt 3 ><td>&nbsp;</td></#if><!-- fill the row -->
  <#if row?size lt 2 ><td>&nbsp;</td></#if>
  </tr>

</#list>
于 2018-05-22T04:50:41.270 回答