4

I have to draw a report with mpdf. The report use <table> to display rows. I would like to fix the height of the <table> (not the height of <td>) like this : <table height="600"> or <table style="height:600px"> but it seems impossible. I'm trying to add this in mpdf.php but it seems that it will take few days to do it!

Has any one any idea to solve this?

Thank you

IRIS
  • 61
  • 2
  • 5

4 Answers4

4

I had the same problem with tables, I added this to my code and seems to work very well

$mpdf->keep_table_proportions = true;
Flaco
  • 76
  • 3
1

MPDF doesn't work well with tables. I can tell you that from experience. If you want precise sizes/margins/etc use DIV tags and always side with padding instead of margin in your CSS.

Brian
  • 3,013
  • 19
  • 27
0

TCPDF seems to interpret valid CSS, so here's an example you can use...

Add a Class or ID to your table element

<table class="tblStyle1">

Then in your css file:

table.tblStyle1 { width:400px; height:500px; min-height:500px !important; }

Timothy Perez
  • 20,154
  • 8
  • 51
  • 39
0

TCPDF class is probably better for what you need... http://sourceforge.net/projects/tcpdf/files/

It's being worked on constantly and probably will give you the flexibility that you're talking about, especially when it comes to fonts.

Enjoy!

Timothy Perez
  • 20,154
  • 8
  • 51
  • 39
  • 1
    I used TCPDF for 3 years but it has some problems that I fixed with mpdf especially for listing multipages, header of tables, ... and mpdf is fully compatible with HTML and more flexible – IRIS Mar 27 '12 at 14:38