PHPExcel: Change Font Size
Question by PC Control | 2015-05-31 at 21:20
I am using the library PHPExcel in order to be able to create some Excel documents respectively XLSX files on my website dynamically.
Now, I would like to modify the font size of some cells in the spreadsheet. Up to now, all text is written in the default font size.
Is this possible? And if so, with which function?
Related Topics
Fonts for Windows, Linux and Mac on the Web
Article | 0 Comments
CSS: Include CSS Stylesheets in HTML
Tutorial | 0 Comments
HTML5 Canvas: Beginner Tutorial Chapter 4 - Write Text on Canvas
Tutorial | 0 Comments
Lazarus: Get Default Font Size of Application and Controls
Question | 1 Answer
PHPExcel: Freeze first Line and Column
Question | 2 Answers
Lazarus: Determine Default-Font or System-Font of Form, Label, Edit and Button
Question | 3 Answers
Lazarus IDE: Font size adjusts automatically
Question | 1 Answer
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
With getFont()->setSize(), you can set the font size of one or several cells.
As an example, the following code we are setting the text in cell A1 to font size 18:
If we would like to adjust multiple cells at the same time, we can also define a larger range:
For instance, here, we are selecting the cells B1 to B10, with which we are setting the font size in some fields of the second column.
2015-06-01 at 18:35