我试图在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';
}结果如下所示:

发布于 2020-03-19 06:13:35
看起来它已经将两个文本都放在了第一列,并设置了colspan2
因此,尝试将光标放到第三列/单元格中
$Cell = $row->getCell(2);
$Cell->createTextRun('Row 1 cololum 2');https://stackoverflow.com/questions/60747763
复制相似问题