这是一个屏幕截图,可以更清楚地向您解释我的第二个单元格如何与第一个单元格重复1我是 PHP 新手,我试图从 fpdf 制作一个 pdf,但困难是我想在每个单元格旁边对齐两个单元格其他,但单元格在彼此旁边重复。这是我的代码:
require("library/fpdf/fpdf.php");
class pdf extends fpdf {
enter code here
function Footer() {
enter code here
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$ctr=0;
$pdf = new pdf('P','mm','A4');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetMargins(10,10,10);
$pdf->SetXY(5,5);
while ($lbl = mysql_fetch_assoc($get))
{
$ctr++;
$pdf->SetFont('Arial','B',8);{
$pdf->Cell(85,6,$lbl["hotelname"],1,0,'L');}
$pdf->SetFont('Arial','B',8);{
$pdf->Cell(85,6,$lbl["hotelname"],1,1,'L');}
$pdf->SetFont('Arial','',8);{
$pdf->Cell(85,6,"Haji No-".$lbl["hajino"]."Ctr-"." ".$ctr,1,0,'L');
$pdf->Cell(85,6,"Haji No-".$lbl["hajino"]."Ctr-"." ".$ctr,1,1,'L');
}
$pdf->Cell(85,6,$lbl["suffix"]." ". $lbl["surname"]." ". $lbl["name"]." ". $lbl["midname"],1,0,'L');
$pdf->Cell(85,6,$lbl["suffix"]." ". $lbl["surname"]." ". $lbl["name"]." ". $lbl["midname"],1,1,'L');
$pdf->SetFont('Arial','B',8);{
$pdf->Cell(85,6,"Room No - ". $lbl["roomno"]." "." "." "." "." "." "." ". "Bus No- ".$lbl["busname"],1,0,'L');
$pdf->Cell(85,6,"Room No - ". $lbl["roomno"]." "." "." "." "." "." "." ". "Bus No- ".$lbl["busname"],1,1,'L');
$pdf->Ln(10);
}
}
$pdf->Output('Hotel_label.pdf','D');
} // Submit Tag Close
}