将 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-.NET | |
// Open the template file | |
Workbook workbook = new Workbook(sourceDir + "AddTooltipToHtmlSample.xlsx"); | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.AddTooltipText = true; | |
// Save as Markdown | |
workbook.Save(outputDir + "AddTooltipToHtmlSample_out.html", options); |