- 导出文件excel并打开时,我遇到了问题:
excel文件的列随每个屏幕尺寸扩展,我想为所有屏幕固定其宽度。
- 注意:我想以像素为单位设置宽度。
- 这是我的代码:
$this->_
phpExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(false);
$this->_phpExcel->getActiveSheet()->getColumnDimension('A')->setWidth(35.73);
$this->_phpExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(false);
$this->_phpExcel->getActiveSheet()->getColumnDimension('B')->setWidth(35.73);
$this->_phpExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(false);
$this->_phpExcel->getActiveSheet()->getColumnDimension('C')->setWidth(10.72);
$this->_phpExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(false);
$this->_phpExcel->getActiveSheet()->getColumnDimension('D')->setWidth(11.53);
$this->_phpExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(false);
$this->_phpExcel->getActiveSheet()->getColumnDimension('E')->setWidth(17.44);