【发布时间】:2017-02-21 10:04:42
【问题描述】:
在我的应用程序中,我有一个包含产品的 json 文件。 在一个循环中,我遍历每个项目并将它们放入单元格中。
$this->row = 4;
foreach ($this->json['products'] as $product) {
$this->template->getActiveSheet()->setCellValueByColumnAndRow(6, $this->row, $product);
$this->row++;
}
之后,我正在设置excel文件的样式
$this->template->getActiveSheet()->mergeCells('J6:K6');
基本上将行 J 和 K 相互合并,但正因为如此,K 的值被删除。无法访问的行合并后,如何将K 的值动态设置为下一行的值?
【问题讨论】:
标签: php excel row cell phpexcel