我正在Odoo中创建一个自定义的发票模板,并且即使只有很少的发票行,我也需要发票行表来占据大部分屏幕。这是表格的代码:
<table class="cr-table" style="height:200px;margin-top:0px">
<thead class="cr-th">
<tr>
<th>Your Item #</th>
<th>Product Description</th>
<th class="text-right">U of M</th>
<th class="text-right">Qty Ordered</th>
<th class="text-right">Qty Shipped</th>
<th class="text-right">Unit Price</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="cr-tbody" style="height:100%">
<tr>
<td colspan="7">
<span t-field="o.pre_text"/>
</td>
</tr>
<tr t-foreach="o.invoice_line" t-as="l">
<td><span t-field="l.product_id.default_code"/></td>
<td><span t-field="l.name"/></td>
<td class="text-right"><span t-field="l.uos_id"/></td>
<td class="text-right"><span t-field="l.quantity_ordered"/></td>
<td class="text-right"><span t-field="l.quantity"/></td>
<td class="text-right">
<span t-field="l.price_unit"/>
<!-- t-field-options='{“digits”:5}'/> -->
</td>
<td class="text-right" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
<td class="text-right">
<span t-field="l.price_subtotal"/>
<!-- t-field-options='{"widget": "monetary"}'/> -->
<!-- "display_currency": "o.currency_id" -->
</td>
</tr>
<tr>
<td colspan="7">
<span t-field="o.post_text"/>
</td>
</tr>
</tbody>
</table>
以%设置高度不会执行任何操作,min-height不会执行任何操作,以像素为单位的高度有效,但是我需要发票行与顶部对齐,因为在当前状态下,它们只是均匀地分布在整个表格中,我需要它们不管有多少条发票行,它们之间的间距都相同。另外,从我尝试过的方法来看,qweb似乎不支持css3,这是真的吗?
将以下内容添加到CSS:
table.cr-table tbody tr:last-child
{
height:100%;
}