我正在尝试在 colspan 列之后添加文本,但我尝试过的任何方法都没有奏效。这是我到目前为止所尝试的。
// Create a shape (table)
$tableShape = $currentSlide->createTableShape(3);
$tableShape->setHeight(1200);
$tableShape->setWidth(960);
$tableShape->setOffsetX(0);
$tableShape->setOffsetY(0);
// Add row
$row = $tableShape->createRow();
$cell = $row->nextCell();
$cell->setColSpan(2);
$cell->createTextRun('Row 1 Colspan cololum 1');
$Cell = $row->nextCell();
$Cell->createTextRun('Row 1 cololum 2');
// Add row
echo date('H:i:s') . ' Add row'.EOL;
$row = $tableShape->createRow();
$oCell = $row->nextCell();
$oCell->createTextRun('R2C1');
$oCell = $row->nextCell();
$oCell->createTextRun('R2C2');
$oCell = $row->nextCell();
$oCell->createTextRun('R2C3');
// Save file
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
if (!CLI) {
include_once 'Sample_Footer.php';
}
结果如下: