Hi Jacob,
Thank you for using Syncfusion products.
We have checked the reported query, and we would like to let you know that your requirement for applying border using ‘format()’ method can be achievable by passing (top, left, bottom, right & isGridBorder) property values in ‘border’ object based on your border type. In the provided code example, you have to define like the below codes to works it instead of defining single CSS property.
//Color should be defined as hex code value.
//Thick box border
xlFormat.format({ "style": { "border": { top: "2px solid #000000", left: "2px solid #000000", bottom: "2px solid #000000", right: "2px solid #000000" } } }, "A1:AA2");
//All border
xlFormat.format({ "style": { "border": { top: "1px solid #000000", left: "1px solid #000000", bottom: "1px solid #000000", right: "1px solid #000000", isGridBorder: true } } }, "A1:AA2");
|
We have further improved the way of applying borders by the ‘setBorder()’ method to simplify the parameters based on type, style & color properties. The above highlighted functionality can be simplified by using setBorder() method as like below,
//Thick box border
this.setBorder({ type: "thickbox", color: "#000000", style: "solid" }, "A1:AA2");
//All border
this.setBorder({ type: "allborder", color: "#000000", style: "solid" }, "A1:AA2");
|
So, we suggest you to use the ‘setBorder()’ instead of using ‘format()’ to apply borders in Spreadsheet. Please refer the below help documentation link and border & wrap text sample link.
Please check the above information and get back to us if you need further assistance.
Regards,
Silambarasan