在 Python 中显示或隐藏网格线

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

如何隐藏网格线

要隐藏工作表,请使用Aspose.Cells Java 对于 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."

如何显示网格线

要使网格线可见,请使用 Worksheet 类的 setGridlinesVisible(true) 方法。

Python 代码

 # Displaying the gridlines of the worksheet

worksheet.setGridlinesVisible(True)

下载运行代码

下载**显示隐藏网格线 (Aspose.Cells)**来自以下任何一个社交编码网站: