You can set the borders of the surrounding row instead of the cells.
var oThis = this,
oParent = oThis.parent;
if (oThis.rawValue.match(/^(Sub-Total:|Grand Total:)$/g)) {
oThis.font.weight = "bold";
oParent.border.getElement("edge",0).presence = "visible";
oParent.border.getElement("edge",1).presence = "invisible";
oParent.border.getElement("edge",2).presence = "visible";
oParent.border.getElement("edge",3).presence = "invisible";
}
If you only want set the borders of specific cells on each row you can do this the following way:
var oThis = this,
oParent = oThis.parent;
if (oThis.rawValue.match(/^(Sub-Total:|Grand Total:)$/g)) {
oThis.font.weight = "bold";
// Modify cell named "Cell1"
oParent.Cell1.border.getElement("edge",0).presence = "visible";
oParent.Cell1.border.getElement("edge",1).presence = "invisible";
oParent.Cell1.border.getElement("edge",2).presence = "visible";
oParent.Cell1.border.getElement("edge",3).presence = "invisible";
// Modify cell named "Cell3"
oParent.Cell3.border.getElement("edge",0).presence = "visible";
oParent.Cell3.border.getElement("edge",1).presence = "invisible";
oParent.Cell3.border.getElement("edge",2).presence = "visible";
oParent.Cell3.border.getElement("edge",3).presence = "invisible";
}