简体   繁体   English

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

[英]How to add inline style for double underlined text in a cell after copying in spreadjs

I have been trying add custom inline styles for the cells where double underline is applied.我一直在尝试为应用双下划线的单元格添加自定义内联 styles。 My plan was to get the cell where the double underline is aplied and using its indexes find the currosponding td and then aplly custom style/tag.我的计划是获取应用双下划线的单元格,并使用其索引找到当前对应的 td,然后应用自定义样式/标签。 Currently i am able to find the row and column indexes but if at all i find the row and colum index how can i find the currosponding td in the html string?目前我能够找到行和列索引,但如果我找到行和列索引,我如何在 html 字符串中找到当前对应的 td? Is there any way to find td using the row and column index?有没有办法使用行和列索引找到 td ? Is there any way to get this done, please let me know.有什么办法可以做到这一点,请告诉我。

To apply a double underline border style to a cell / range by using the setBorder method with the LineStyle double and the borderBottom method For example, to set a double underline to the cell A1:使用带有LineStyle doubleborderBottom 方法setBorder 方法将双下划线边框样式应用于单元格/范围 例如,为单元格 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);
};

If you have any other questions feel free to reach out to the SpreadJS Support Team here: Submit a ticket如果您有任何其他问题,请随时与 SpreadJS 支持团队联系:提交工单

Best, Mackenzie Albitz |最佳,麦肯齐·阿尔比兹 | GrapeCity Technical Engagement Engineer GrapeCity 技术参与工程师

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM