column width completion

This commit is contained in:
Antoine Robidoux 2016-05-19 17:15:57 -04:00
parent 888845a353
commit 7e4d56be46
2 changed files with 25 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class Workbook extends AbstractWorkbook
$xlFolder = $this->fileSystemHelper->getXlFolder();
$this->sharedStringsHelper = new SharedStringsHelper($xlFolder);
$this->columnwidths = $columnwidths
$this->columnwidths = $columnwidths;
}
/**

View File

@ -67,11 +67,29 @@ class Writer extends AbstractMultiSheetsWriter
return $this;
}
/**
* Clear all column width specification
* @return Writer
*/
public function clearColumnWidth() {
$this->cellwidths = array();
$this->columnwidths = array();
if( $this->book )
$this->book->_setColumnWidth( $this->columnwidths );
return $this;
}
/**
* Add a width definition for the next sheet that will be generated
* @param number $width column width
* @param number $min column position ( A=1 ) where this width should take effect
* @param number $max end of range where width take effect ( default to min )
* @return Writer
*/
public function setColumnsWidth($width, $min, $max = null) {
if( $max === null )
$max = $min;
@ -80,6 +98,11 @@ class Writer extends AbstractMultiSheetsWriter
'min' => $min,
'max' => $max
);
if( $this->book )
$this->book->_setColumnWidth( $this->columnwidths );
return $this;
}
/**