Create Table by Using Border Lines for a Range
Contents[ Hide ]
Sometimes, you want to create a table by adding border lines for a Range/CellArea based on the address of the cells you have. You can use Cells.createRange method to create a range of cells. The Cells.createRange method returns a Range object. You can create a Style object and specify the borders (top, left, bottom, right) options accordingly. Later, you may get the cells of the Range and apply your desired formatting to the cells.
The following example shows how to create a Range and specify the borderlines for the range cells.
After running the above code, we can have the generated excel file containing the formatted table; here is the screenshot of the file.