Prefisso degli stili degli elementi della tabella con la proprietà HtmlSaveOptions.TableCssId

Possibili Scenari di Utilizzo

Aspose.Cells consente di prefissare gli stili degli elementi della tabella con la proprietà HtmlSaveOptions.TableCssId. Supponiamo di impostare questa proprietà con un qualche valore come MyTest_TableCssId, allora troverai gli stili degli elementi della tabella come mostrato di seguito

table#MyTest_TableCssId

#MyTest_TableCssId tr

#MyTest_TableCssId col

#MyTest_TableCssId br

etc.

La seguente schermata mostra l’effetto dell’utilizzo della proprietà HtmlSaveOptions.TableCssId sull’HTML di output.

todo:image_alt_text

Prefisso degli stili degli elementi della tabella con la proprietà HtmlSaveOptions.TableCssId

Il codice di esempio seguente spiega come fare uso della proprietà HtmlSaveOptions.TableCssId. Si prega di controllare l'HTML di output generato dal codice per un riferimento.

Codice di Esempio

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
//Create workbook object
Workbook wb = new Workbook();
//Access first worksheet
Worksheet ws = wb.getWorksheets().get(0);
//Access cell B5 and put value inside it
Cell cell = ws.getCells().get("B5");
cell.putValue("This is some text.");
//Set the style of the cell - font color is Red
Style st = cell.getStyle();
st.getFont().setColor(Color.getRed());
cell.setStyle(st);
//Specify html save options - specify table css id
HtmlSaveOptions opts = new HtmlSaveOptions();
opts.setTableCssId("MyTest_TableCssId");
//Save the workbook in html
wb.save("outputTableCssId.html", opts);