我使用FPDF动态生成。我按照教程http://fpdf.org/en/script/script20.php进行了操作。我想给我的表标题提供换行符,以便我能以正确的方式对齐数据。我尝试使用<br />
标记,但它不起作用。它只显示标签。
这是我的代码:
$cols=array( "Item Code" => 15,
"Product Name <br />UOM" => 15,
"Description" => 30,
"Price" => 15,
"Qty" => 10,
"Disc%" => 10,
"Sub-Total" => 15,
"NLSP<br /> Rate" => 15,
"Amt" => 15,
"LSLD Rate" => 15,
"SAmt" => 15,
"MSLS Rate" => 15,
"IAmt" => 15,
);
$pdf->addCols( $cols);
$cols=array( "Item Code" => "R",
"Product Name <br />UOM" => "R",
"Description" => "C",
"Price" => "R",
"Qty" => "R",
"Disc%" => "R",
"Sub-Total" => "R",
"NLSP<br /> Rate" => "L",
"Amt" => "L",
"LSLD Rate" => "L",
"SAmt" => "L",
"MSLS Rate" => "L",
"IAmt" => "L",
);
$pdf->addLineFormat( $cols);
$pdf->addLineFormat($cols);
$y = 133;
函数addCols( $cols)
和addLineFormat
与fpdf脚本中的相同。