Exportar Excel a HTML con Líneas de Cuadrícula

Exportar Excel a HTML con Líneas de Cuadrícula

El siguiente código de ejemplo crea un libro e inserta algunos valores en su hoja, y luego lo guarda en formato HTML tras configurar la propiedad HtmlSaveOptions.export_grid_lines en true.

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)