Cell Değerini HTML kullanarak ayarlayarak Madde İşaretlerini Görüntüle
Contents
[
Hide
]
Aspose.Cells, HTML koduyla madde işaretlerini göstermeyi destekler. Bu makale, HTML kullanarak hücre değerini ayarlayarak madde işaretlerinin nasıl görüntüleneceğini açıklayacaktır.Cell.HtmlString HTML ile hücre değerini ayarlama özelliği.
HTML kullanarak Cell değerini ayarlayarak Madde İşaretlerini görüntülemek için C# kodu
Aşağıdaki kod, hücre değerini ayarlamak için HTML kodunu kullanır. Bir kez, bu kodu çalıştıracaksınız, çıktıyı aşağıdaki resimde gösterildiği gibi alacaksınız.
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create workbook object | |
Workbook workbook = new Workbook(); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access cell A1 | |
Cell cell = worksheet.Cells["A1"]; | |
// Set the HTML string | |
cell.HtmlString = "<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(dataDir + "BulletsInCells_out.xlsx"); |
Örnek kod tarafından oluşturulan çıktı
Aşağıdaki ekran görüntüsü, yukarıdaki örnek kodun çıktısını gösterir.