Closed perlAddict closed 5 years ago
Can you add a small complete working example the demonstrates the issue.
The following example creates the table but does not apply the header formatting.
#!/tool/pandora64/bin/perl5.8.8
use strict;
use warnings;
use Excel::Writer::XLSX;
my $workbook = Excel::Writer::XLSX->new("example.xlsx");
my $worksheet = $workbook->add_worksheet('example');
my $table = [
['data1','data2','data3',],
['data4','data5','data6',],
['data7','data8','data9',]
];
my $format = $workbook->add_format(text_wrap => 1);
my @colDefs = (
{
header => 'This is the first column',
header_format => $format,
},
{
header => 'This is the second column',
header_format => $format,
},
{
header => 'This is the third column',
header_format => $format,
},
);
$worksheet->add_table(
2,0, scalar(@$table)+2, scalar(@colDefs)-1,
{
data => $table,
columns => \@colDefs,
style => 'None',
}
);
$workbook->close();
It appears to apply the formatting header. Here is the output from your program:
Am I missing something?
I am not sure why but running that same program doesn't apply the header formatting for me. Do you have any idea what might be the cause of this issue?
What version of Excel::Writer::XLSX are you using? And what version of Excel?
Any followup on this?
Closing as unreproducible.
Hi,
I am trying to add formatting to my header row using
The formatting doesn't get applied. 'header_format' doesn't work but 'format' works (but I want to apply formatting to header not the column data). Is this feature enabled?