PHPExcel: Create Multi Line Cell
Question by PC Control | Last update on 2021-06-28 | Created on 2015-02-07
I would like to insert a line break within one table cell using PHPExcel. In other words, I would like to create a field containing multiple lines.
I have just tried to write some content with the usual subjects into the cell (that is inserting a string with \n or \r\n), but all of this is not leading to any success.
Is it at all possible to write multiline values to cells using PHPExcel? Or what am I doing wrong here?
Related Topics
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
MySQL: Line Breaks in MySQL
Tip | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
PHPExcel: Freeze first Line and Column
Question | 2 Answers
Repair Text Files with mixed Line Breaks
Tutorial | 0 Comments
HTML: Table - Merge Cells
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.
Your approach using the \n came out okay, but you have also care about setting the WrapText property of the desired cell to true to make Excel interpreting the line break correctly.
Additionally, it is important to always specify the value using double quotes, otherwise the interpretation of \n is also not working.
Last update on 2021-06-28 | Created on 2015-02-09
setWrapText is not working in office 2013 but it works in 2007 correctly.
2018-05-26 at 10:12