[]
        
(Showing Draft Content)

Shrink to Fit

The shrink to fit feature attempts to display all the text in the cell. The font size is reduced if the text is too long for the visible area of the cell.


The difference between a cell that supports shrink to fit and a cell that does not can be observed in the image below.




Cell B2 supports the shrink to fit option. Cell B3 sets the shrinkToFit method to false.


The following code sample shows how to set the shrinkToFit method.

activeSheet.getCell(1,1).shrinkToFit(true);
activeSheet.getCell(1,1).text("Shrink To Fit Test");
activeSheet.getCell(2,1).shrinkToFit(false);
activeSheet.getCell(2,1).text("Shrink To Fit Test");