如何在 spreadjs 中复制后为单元格中的双下划线文本添加内联样式



我一直在尝试为应用双下划线的单元格添加自定义内联样式。我的计划是获取应用双下划线的单元格,并使用其索引找到卷曲的 td,然后自定义样式/标签。 目前我能够找到行和列索引,但是如果我找到行和列索引,如何在 html 字符串中找到 currosponding td? 有没有办法使用行和列索引找到td? 有什么方法可以完成这项工作,请告诉我。

通过将 setBorder 方法与 LineStyle Double 和 borderBottom 方法结合使用,将双下划线边框样式应用于单元格/范围 例如,要为单元格 A1 设置双下划线:

window.onload = function (dashboard) {
// Initialize the Spread component with the following line:
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var activeSheet = spread.getActiveSheet();
// create line border
var border = new GC.Spread.Sheets.LineBorder();
border.color = "red";
// line style = double
border.style = GC.Spread.Sheets.LineStyle.double;
var cell = activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport);
// setting the border to the bottom
cell.borderBottom(border);
};

如果您有任何其他问题,请随时在这里联系SpreadJS支持团队:提交工单

最佳,麦肯齐·阿尔比茨 |葡萄城技术参与工程师

最新更新