在 Python 中显示或隐藏网格线

Aspose.Cells - 显示隐藏网格线

隐藏网格线

使用隐藏工作表Aspose.Cells Java 红宝石, 称呼显示隐藏网格线模块。

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)**来自以下任何社交编码网站: