次のような分割/結合セルを含むテーブルを含む PDF を生成しようとしています。
セル | セル | セル | セル | セルセル
| セルセル C1 | C2 | セル| セル
| C1 | C2 | 細胞
私は fpdf を使用しており、以前に同様の pdf で使用したマルチセル テーブル スクリプトを参照しました。コードを見て、必要に応じてセルを分割または結合する方法が思いつきません。誰もこれを行う方法を知っていますか?
セル幅が結合されたセルの両方の合計になるように手動で行うだけです。
あなたの例によると:
$column_widths = ["50","50","50","50"];
// First row.
$pdf->Cell($column_widths[0], 5, "Cell", "", 0, "C", false);
$pdf->Cell($column_widths[1] + $column_widths[2], 5, "Cell", "", 0, "C", false);
$pdf->Cell($column_widths[3], 5, "Cell", "", 0, "C", false);
// Second row.
$pdf->Cell($column_widths[0], 5, "Cell", "", 0, "C", false);
$pdf->Cell($column_widths[1], 5, "C1", "", 0, "C", false);
$pdf->Cell($column_widths[2], 5, "C2", "", 0, "C", false);
$pdf->Cell($column_widths[3], 5, "Cell", "", 0, "C", false);
// Third row.
$pdf->Cell($column_widths[0], 5, "", "", 0, "C", false);
$pdf->Cell($column_widths[1], 5, "C1", "", 0, "C", false);
$pdf->Cell($column_widths[2], 5, "C2", "", 0, "C", false);
$pdf->Cell($column_widths[3], 5, "Cell", "", 0, "C", false);
またはそのようなもの。