Mostra Elenco puntato impostando il Valore della Cella utilizzando HTML
Contents
[
Hide
]
Aspose.Cells supporta ora la visualizzazione di elenchi puntati con codice HTML. Questo articolo spiegherà come visualizzare elenchi puntati impostando il valore della cella utilizzando HTML. Utilizzeremo la proprietà Cell.setHtmlString() per impostare il valore della cella con il nostro HTML.
Visualizza pallini impostando il valore della cella utilizzando HTML
Il codice seguente utilizza il codice HTML per impostare il valore della cella. Una volta eseguito questo codice, otterrai l’output mostrato nell’immagine sottostante.
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(DisplayBullets.class); | |
//Create workbook object | |
Workbook workbook = new Workbook(); | |
//Access first worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
//Access cell A1 | |
Cell cell = worksheet.getCells().get("A1"); | |
//Set the HTML string | |
cell.setHtmlString("<font style='font-family:Arial;font-size:10pt;color:#666666;vertical-align:top;text-align:left;'>Text 1 </font><font style='font-family:Wingdings;font-size:8.0pt;color:#009DD9;mso-font-charset:2;'>l</font><font style='font-family:Arial;font-size:10pt;color:#666666;vertical-align:top;text-align:left;'> Text 2 </font><font style='font-family:Wingdings;font-size:8.0pt;color:#009DD9;mso-font-charset:2;'>l</font><font style='font-family:Arial;font-size:10pt;color:#666666;vertical-align:top;text-align:left;'> Text 3 </font><font style='font-family:Wingdings;font-size:8.0pt;color:#009DD9;mso-font-charset:2;'>l</font><font style='font-family:Arial;font-size:10pt;color:#666666;vertical-align:top;text-align:left;'> Text 4 </font>"); | |
//Save the workbook | |
workbook.save(dataDir + "output.xlsx"); |
Output
Lo screenshot seguente mostra l’output del codice di esempio precedente.