Tablo Elemanları Stillerini HtmlSaveOptions.TableCssId özelliğine sahip Önek
Contents
[
Hide
]
Olası Kullanım Senaryoları
Aspose.Cells, tablo öğeleri stillerinin önüne şunu eklemenizi sağlar:HtmlSaveOptions.TableCssIdEmlak. Diyelim ki, bu özelliği şöyle bir değerle ayarladınız:MyTest_TableCssId, o zaman aşağıda gösterildiği gibi tablo öğeleri stilleri bulacaksınız
table#MyTest_TableCssId
# MyTest_TableCssId tr
# MyTest_TableCssId col
# MyTest_TableCssId br
etc.
Aşağıdaki ekran görüntüsü, kullanmanın etkisini gösterir.HtmlSaveOptions.TableCssIdHTML çıkışındaki özellik.
Tablo Elemanları Stillerini HtmlSaveOptions.TableCssId özelliğine sahip Önek
Aşağıdaki örnek kod, nasıl kullanılacağını gösterirHtmlSaveOptions.TableCssId Emlak. lütfen kontrol edinizçıkış HTML referans için kod tarafından oluşturulur.
Basit kod
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 | |
//Create workbook object | |
Workbook wb = new Workbook(); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Access cell B5 and put value inside it | |
Cell cell = ws.Cells["B5"]; | |
cell.PutValue("This is some text."); | |
//Set the style of the cell - font color is Red | |
Style st = cell.GetStyle(); | |
st.Font.Color = Color.Red; | |
cell.SetStyle(st); | |
//Specify html save options - specify table css id | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.TableCssId = "MyTest_TableCssId"; | |
//Save the workbook in html | |
wb.Save("outputTableCssId.html", opts); |