Change font size of excel file
Change font size of excel file
Muhsina
Posts: 4Questions: 1Answers: 0
Hi,
How can I change the font size of exported excel file from default font size 11
Thanks
This discussion has been closed.
Answers
You'd need to use the
customize
callback of theexcelHtml5
button type to customise the XML that is used for the spreadsheet. This is the element that you'd probably want to change.Allan
Thanks allan for your response. I tried changing the code as follows. But that didn't work for me.
"xl/styles.xml":
'<?xml version="1.0" encoding="UTF-8"?>'+
'<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'+
'<fonts count="5" x14ac:knownFonts="1">'+
'<font>'+
'<sz val="13" />'+
'<name val="Calibri" />'+
'</font>'+
'<font>'+
'<sz val="13" />'+
'<name val="Calibri" />'+
'<color rgb="FFFFFFFF" />'+
'</font>'+
'<font>'+
'<sz val="13" />'+
'<name val="Calibri" />'+
'<b />'+
'</font>'+
'<font>'+
'<sz val="13" />'+
'<name val="Calibri" />'+
'<i />'+
'</font>'+
'<font>'+
'<sz val="13" />'+
'<name val="Calibri" />'+
'<u />'+
'</font>'+
'</fonts>'+
Happy to take a look at a test page showing the issue with your modified code.
Allan
For future referencing, I've answered this question here :
https://stackoverflow.com/questions/54665113/how-to-change-the-font-size-of-excel-file-exported-from-a-datatable/54665540#54665540