在Python中显示或隐藏网格线

Aspose.Cells - 如何显示或隐藏网格线

如何隐藏网格线

要使用Aspose.Cells Java for Ruby隐藏工作表,请调用displayhidegridlines模块。

Python 代码

 workbook = self.Workbook(self.dataDir + "Book1.xls")

#Accessing the first worksheet in the Excel file

worksheets = workbook.getWorksheets()

worksheet = worksheets.get(0)

#Hiding the grid lines of the first worksheet of the Excel file

worksheet.setGridlinesVisible(False)

#Saving the modified Excel file in default (that is Excel 2000) format

workbook.save(self.dataDir + "output.xls")

\# Print message

print "Grid lines are now hidden on sheet 1, please check the output document."

如何显示网格线

要显示网格线,使用工作表类的setGridlinesVisible(true)方法。

Python 代码

 # Displaying the gridlines of the worksheet

worksheet.setGridlinesVisible(True)

下载运行代码

从以下任何社交编码网站下载DisplayHideGridlines (Aspose.Cells)