0

I am using third party code for HTML To PDF conversion is working good.But this cannot accept rowspan why?? Here is my code.

require('WriteHTML.php');
$pdf=new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<para><h1>Title</h1>');
$pdf->SetFont('Arial','B',7); 

$htmlTable="<TABLE border='1'>

<TR height='40'>
<TD>S.NO</TD>
<TD>Type Of Beneficiary</TD>
<TD>Expected</TD>
<TD>No.Of Beneficiary</TD>
<TD>No.Of Packs Issued</TD>
<TD>Ave.monthly Usage</TD>
<TD>Balance Stock Available</TD>
</TR>

 <TR>
 <TD>1</TD>
 <TD>Adolescents Girls</TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD ></TD>
 </TR>

  <TR>
  <TD rowspan='4'>2</TD>
  <TD>Normal</TD>
  <TD>ALLOTMENT NO</TD>
  <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   <TD rowspan='4'></TD>
   </TR>
   <TR>
   <TD>LSCS</TD>
   <TD>ALLOTMENT NO</TD>
   <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   </TR>
   <TR>
   <TD>Puperial Sterilization</TD>
   <TD>ALLOTMENT NO</TD>
   <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   <TD>QUANTITY</TD>
   </TR>
   <TR>
  <TD>Total</TD>
  <TD>ALLOTMENT NO</TD>
  <TD>QUANTITY</TD>
  <TD>QUANTITY</TD>
  <TD>QUANTITY</TD>
  </TR>

 <TR>
 <TD>3</TD>
 <TD>Women Prison Inmates</TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 </TR>
 <TR>
 <TD>4</TD>
 <TD>Women IMH Inmates</TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 </TR>
 <TR>

 <TD>5</TD>
 <TD>Total</TD>
 <TD> </TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 <TD></TD>
 </TR>



 </TABLE>";
 $pdf->WriteHTML2("$htmlTable"); 
 $pdf->Output();
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
sarath jay
  • 21
  • 2
  • 7

2 Answers2

0

It seems FPDF doesn't support rowspan:

FPDF does not recognize rowspan or colspan. Here is a workaround that you can try, using empty cells and the border attribute for Cell.

by Sean (emphasis mine) - here is the full answer

Community
  • 1
  • 1
Marcel Burkhard
  • 3,453
  • 1
  • 29
  • 35
0

Rowspan and Colspan supporting the TCPDF Library.And also easy configration this one. Library path http://www.tcpdf.org/ and coding path http://www.tcpdf.org/examples/example_048.phps. just change the path only. require_once('tcpdf.php');

sarath jay
  • 21
  • 2
  • 7