This brief tutorial describes how to rotate a cell in Excel using Node.js. It has all the details to set the IDE environment, a list of steps to write the application, and a runnable sample code for rotating cells in Excel using Node.js. You will learn different options to set the style of the text in a cell.
Steps to Rotate Cells in Excel using Node.js
- Set the IDE to use Aspose.Cells for Node.js via Java to rotate a cell
- Create a workbook, access a worksheet, and get access to the desired cell
- Set some sample text in the target cell
- Get access to the Style object of the target cell
- Call the Style.setRotationAngle() to rotate the content in the cell
- Set style back to the target cell before saving the output workbook
These steps define the process of changing text orientation in Excel using node.js. The process is initiated by accessing the cell and getting its style using the getStyle() method. The Style class contains the setRotationAngle() method that is finally used to set the text rotation angle.
Code to Rotate Excel Cells using Node.js
This sample code demonstrates how to rotate Excel cells using Node.js. You may set the angle to 255 for top to bottom, 90 for upward, -90 for downward, and 0 for not rotated. You can also set other properties in the Style object for instance setBackgroundColor(), setBorder(), and setForegroundColor() to list a few.
This article has taught us how to rotate cells in Excel using Node.js. If you want to add validation in a workbook, refer to the article on how to make a dropdown list in Excel using Node.js.