-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support for autofitting the rows height #333
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi leandrodm. A good start but there are some errors in you code and it doesn't take into account merged cellls. Here is a version of your method that can be placed into the client code and does not require your fork to implement the function. Rather than use a row range, I've gone for performing the action on a single row but this could be adapted to your methodology easily. To get the row you need to do the following:
|
Does this code work with line breaks? |
Hi, |
In the Code from @ianfoulds is an little issue on line 61 by using the generated template again. The $width will added at every use again and again.
Change the code to
|
I can't see that this has been addressed. Am I right? It's 2024. To force all rows in the spreadsheet to auto-adjust to the height of the text, I use: |
This is:
What is the expected behavior?
The lib should be able to have a function that autofits the rows based on the largest cell. I couldn't find any place to do it.
After struggling with this issue I came up with a solution that I would like to share. That's why i'm creating this issue.
What is the current behavior?
I'm not sure if it only happens on Libre Office Calc but if I have a text that has been wrapped before using
getAlignment()->setWrapText(true)
I'm was not able to fit the rows based on the new height of the cells, like when we double click excel/calc rows.Which versions of PhpSpreadsheet and PHP are affected?
"phpoffice/phpspreadsheet": "1.0.0-beta",
"php": ">=5.6.4"
The text was updated successfully, but these errors were encountered: