Converti Excel in HTML con intestazioni
Contents
[
Hide
]
Converti Excel in HTML con intestazioni
Aspose.Cells offre la possibilità di esportare le intestazioni di righe e colonne durante la conversione di Excel in HTML. Ciò può essere ottenuto utilizzandoHtmlSaveOptions.ExportHeadingsproprietà fornita da API. Il valore predefinito diHtmlSaveOptions.ExportHeadings èFalso . PassaggioVero come parametro per il rendering delle intestazioni nel file di output HTML. L’immagine seguente mostra il file di output generato dal codice seguente.
Il codice di esempio seguente illustra l’utilizzo diHtmlSaveOptions.ExportHeadingsproprietà per visualizzare le intestazioni nel file di output HTML.
Codice d’esempio
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
# Load the Sample Workbook | |
workbook = Workbook() | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Access cell A1 and put some text inside it. | |
cell = worksheet.getCells().get("A1") | |
cell.putValue("This is some text.") | |
# Get the Normal and Html5 strings. | |
strNormal = cell.getHtmlString(False) | |
strHtml5 = cell.getHtmlString(True) | |
# Print the Normal and Html5 strings | |
print("Normal:\r\n" + strNormal) | |
print("Html5:\r\n" + strHtml5) |