Hücre İçine HTML Zengin Metin Ekleme
Aspose.Cells, Microsoft Excel odaklı HTML’yi XLS/XLSX biçimine dönüştürmeyi destekler. Yani, Microsoft Excel tarafından oluşturulan HTML tekrar XLS/XLSX biçimine çevrilebilir.
Benzer şekilde, eğer basit bir HTML varsa, Aspose.Cells onu HTML Zengin Metne dönüştürebilir. Cell.setHtmlString(string) yöntemi, böyle basit bir HTML alabilir ve biçimlendirilmiş hücre metnine dönüştürebilir.
Aşağıdaki kod örneği, hücre içine HTML zengin metin eklemenin nasıl yapıldığını gösterir. Lütfen çıktı Excel dosyasının ekran görüntüsüne bakın.
const path = require("path"); | |
// The path to the documents directory. | |
const dataDir = path.join(__dirname, "data"); | |
const AsposeCells = require("aspose.cells.node"); | |
const workbook = new AsposeCells.Workbook(); | |
const worksheet = workbook.getWorksheets().get(0); | |
const cell = worksheet.getCells().get("A1"); | |
cell.setHtmlString("<Font Style=\"FONT-WEIGHT: bold;FONT-STYLE: italic;TEXT-DECORATION: underline;FONT-FAMILY: Arial;FONT-SIZE: 11pt;COLOR: #ff0000;\">This is simple HTML formatted text.</Font>"); | |
workbook.save(dataDir + "output_out.xlsx"); |