Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
18508 Lượt xem

Hello,

In Qweb Report, I would like to set a minimum height to a table (for example 50% of the page).

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

CSS styles works in Qweb

<div style="min-height:100mm;background-color:yellow;">

FOO FOO FOO FOO FOO

</div>

UPDATE:

When using tables, height essentially is min-height, as tables always stretch!

            <table style="height:100mm;background-color:yellow;">
            <tr><td>FOO FOO FOO</td></tr>
            <tr><td style="background-color:red;">FOO1 FOO1 FOO1</td></tr>
            </table>

 

 

 

Ảnh đại diện
Huỷ bỏ
Tác giả

@zbik Your new solution still set height to an element of table, not to the complete table

height is set for complete table, not for element, you add new row with other background-color and test.

Tác giả

@zbik sorry, it doesn't work for me.

Tested, in my system works without any problem in PDF and HTML reports.

PS. wkhtmltopdf -V .... wkhtmltopdf 0.12.1 (with patched qt)

Tác giả

same version for me. see my updated answer

Tác giả Câu trả lời hay nhất

@zbik

it's strange : it works with <table style="height:150mm;"> but not with <table class="table table-condensed table-hover border" style="height:150mm;">

Ảnh đại diện
Huỷ bỏ

Try CSS code : html, body { height: 100%; } table{ height:50%; position: absolute; top:25%; }

Tác giả

@José It doesn't work for me :Table appears on the top of the page . Could you try for example on the first table in sale.report_saleorder_document ? Thanks

Answer updated

Tác giả

Answer updated

not sure if this helps, but try: style="height:150mm !important;"

and you test tbody tag

Tác giả

it still does not work. I'll be busy with something else for a few days. I will take this problem later. Thanks

In my system works right in both cases

Tác giả

In fact, the problem occurs when I use "t-foreach" loop inside tbody tag