Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widths does not take effect #359

Open
anlondon opened this issue Apr 19, 2024 · 1 comment
Open

widths does not take effect #359

anlondon opened this issue Apr 19, 2024 · 1 comment

Comments

@anlondon
Copy link

writeSheetHeader 前,执行了writeSheetRowwriteSheetHeader中的widths就会不生效

Before writeSheetHeader, if writeSheetRow is executed, widths in writeSheetHeader will not take effect.

$writer  = new XLSXWriter();
$widths = [12, 16, 35, 18, 9, 9, 7, 10, 10, 15, 15, 9, 14, 14, 15, 19, 19];
$style_content = ['height'=>14,'valign'=>'center','font-size'=>11,'font'=>'Calibri,宋体'];
$style_header = ['height'=>14,'halign'=>'center','valign'=>'center','font-size'=>11,'font'=>'Calibri,宋体','widths'=>$widths];

$preheader = [
    ['<服务工作单> 记录','','', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],//A1
    ['日期:',$param['startDate'] . ' to ' . $param['endDate'],'', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],//A2 B2
];
$header = ['工作日期'=>'string', '客户编号'=>'string', '客户公司'=>'string', '合约编号'=>'string', '服务类型'=>'string', '服务状态'=>'string', '期数'=>'string', '费用'=>'string', '单次服务费'=>'string', '首次加做项目'=>'string', '首次加做金额'=>'string', '加班'=>'string', '主要技术员'=>'string', '协作技术员'=>'string', '备注'=>'string', '建立时间'=>'string', '更新时间'=>'string'];
foreach ($preheader as $item)
    $writer->writeSheetRow('WorkSheet',$item,$style_content);
$writer->writeSheetHeader('WorkSheet',$header,$style_header);

希望能获得帮助

hope to get help

@sayid
Copy link

sayid commented Apr 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants