ツールチップ付きでExcelをHTMLに変換する
Contents
[
Hide
]
ツールチップ付きでExcelをHTMLに変換する
生成されたHTMLでテキストが切り取られる場合があり、ホバーイベントで完全なテキストをツールチップとして表示したい場合があります。Aspose.Cellsは、この機能をサポートし、HtmlSaveOptions.AddTooltipTextプロパティを提供しています。 HtmlSaveOptions.AddTooltipTextプロパティをtrueに設定すると、生成されたHTMLに完全なテキストがツールチップとして追加されます。
次の画像は、生成されたHTMLファイル内のツールチップを示しています。
次のコードサンプルは、ソースExcelファイルをロードし、ツールチップを追加した出力HTMLファイルを生成します。
サンプルコード
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-Java | |
//directories | |
String sourceDir = Utils.Get_SourceDirectory(); | |
String outputDir = Utils.Get_OutputDirectory(); | |
// Open the template file | |
Workbook workbook = new Workbook(sourceDir + "AddTooltipToHtmlSample.xlsx"); | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.setAddTooltipText(true); | |
// Save as Markdown | |
workbook.save(outputDir + "AddTooltipToHtmlSample_out.html", options); |