tintu
tintu

Reputation: 1

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. 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. 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 ? Is there any way to find td using the row and column index ? Is there any way to get this done, please let me know.

Upvotes: 0

Views: 322

Answers (1)

MESCIUS Team
MESCIUS Team

Reputation: 847

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:

  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

Best, Mackenzie Albitz | GrapeCity Technical Engagement Engineer

Upvotes: 0

Related Questions