Anzeige von Aufzählungszeichen durch Setzen des Zellenwerts mit HTML

Node.js-Code zum Anzeigen von Punkten durch Setzen des Zellwerts mit HTML

Der folgende Code verwendet den HTML-Code, um den Zellwert festzulegen. Sobald Sie diesen Code ausführen, erhalten Sie die Ausgabe wie im Bild unten.

const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create workbook object
const workbook = new AsposeCells.Workbook();
// Access first worksheet
const worksheet = workbook.getWorksheets().get(0);
// Access cell A1
const 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>");
// Auto fit the Columns
worksheet.autoFitColumns();
// Save the workbook
workbook.save(path.join(dataDir, "BulletsInCells_out.xlsx"));

Ausgabe, die vom Beispielcode generiert wurde

Der folgende Screenshot zeigt die Ausgabe des obigen Beispielcodes.

todo:image_alt_text