2

我在 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>

以 % 为单位设置高度不起作用,最小高度不起作用,以像素为单位的高度起作用,但是我需要发票行与顶部对齐,因为在当前状态下它们只是均匀分布在整个表格中,我需要它们具有无论有多少发票行,它们之间的间距相同。另外,从我的尝试来看,qweb 似乎不支持 css3,这是真的吗? 发票截图

4

1 回答 1

0

将以下内容添加到您的 CSS 中:

table.cr-table tbody tr:last-child
{
    height:100%;
}
于 2020-01-20T22:27:18.723 回答