Esportare Excel in HTML con linee della griglia
Contents
[
Hide
]
Se desideri esportare il tuo file Excel in HTML con le linee della griglia, utilizza la proprietà HtmlSaveOptions.export_grid_lines e impostala su true.
Esportare Excel in HTML con linee della griglia
Il seguente esempio di codice crea un workbook e riempie il suo foglio di lavoro con alcuni valori e poi lo salva in formato HTML impostando la proprietà HtmlSaveOptions.export_grid_lines su true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import HtmlSaveOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create your workbook | |
wb = Workbook() | |
# Access first worksheet | |
ws = wb.worksheets[0] | |
# Fill worksheet with some integer values | |
for r in range(10): | |
for c in range(10): | |
ws.cells.get(r, c).put_value(r * 1) | |
# Save your workbook in HTML format and export gridlines | |
opts = HtmlSaveOptions() | |
opts.export_grid_lines = True | |
wb.save(dataDir + "ExportToHTMLWithGridLines_out.html", opts) |