fixed 2nd simplexls

This commit is contained in:
2023-11-17 17:29:09 +07:00
parent f66f6cdf1e
commit e489035adc
+4 -2
View File
@@ -55,12 +55,14 @@ final class SimpleXLS {
public function add_sheet($tnama_sheet="BARU", $bw_header=true) { public function add_sheet($tnama_sheet="BARU", $bw_header=true) {
for ($i=0; $i<count($this->__atabel); $i++) { for ($i=0; $i<count($this->__atabel); $i++) {
$this->__wbook->setColWidth($this->__kolom, $this->__atabel[$i][1]); $this->__wbook->setColWidth($i, $this->__atabel[$i][1]);
} }
$_jkolom = count($this->__atabel); $_jkolom = count($this->__atabel);
if ($_jkolom>0) $_jkolom--; if ($_jkolom>0) $_jkolom--;
foreach ($this->__aheader as $_key => $_val) { foreach ($this->__aheader as $_key => $_val) {
$this->__avalue[] = array_merge(["<b>".$_val."</b>"],array_fill(1,$_jkolom,null)); $a_out = ["<center><b>".$_val."</b></center>"];
for ($i=0; $i<$_jkolom; $i++) $a_out[] = null;
$this->__avalue[] = $a_out;
} }
if ($bw_header==true) $this->show_headers(); if ($bw_header==true) $this->show_headers();
} }