我尝试过使用 Ln()、MultiCell() 或 Write(),但我总是遇到奇怪的问题。就像在第 1 行和第 6 列之后一样,循环中断,整个布局回退。
foreach($data as $row)
{
$room='-1010B';
$labNo='(L1)';
$this->SetFont('Arial','B',10);
$this->Cell($w[0],15,$row[0],'LR',0,'C',$fill);
$this->SetFont('Arial','',10);
$this->Cell($w[1]+$w[2],15,$row[1]. " " .$room,'LR',0,'C',$fill);
$this->Cell($w[3],15,$row[3]. " " .$room,'LR',0,'C',$fill);
$this->Cell($w[4],15,$row[4]. " " .$room,'LR',0,'C',$fill);
$this->SetFont('Arial','B',9);
$this->Cell($w[5],15,$row[5],'LR',0,'C',$fill);
$this->SetFont('Arial','',10);
if($row[6]!="")
$this->Cell($w[6],15,$row[6]. " " .$room,'LR',0,'C',$fill);
else
$this->Cell($w[6],15,$row[6],'LR',0,'C',$fill);
$this->Cell($w[7]+$w[8]+$w[9],15,$row[7],'LR',0,'C',$fill);
$flag++;
$this->Ln();
$fill =! $fill;
}