-1

I'm tryna use app script to automatically create receipts, but I can't figure out how to customize Tablecell borders with app script. The "Discount/Premium" row is programmatically added each time a receipt is created, and I can't make the first 2 cells' left and bottom border go away. I don't want to include the row in the template as I don't want to show this row when there is no discount or premium.

Thanks in advance for the help

Receipt Image

enter image description here

Cooper
  • 59,616
  • 6
  • 23
  • 54
  • Did you try to google? https://stackoverflow.com/questions/12900359/set-border-color-style-in-spreadsheet-programmatically Is it the answer? – Yuri Khristich May 09 '21 at 18:27
  • Does this answer your question? [Set border color & style in spreadsheet programmatically](https://stackoverflow.com/questions/12900359/set-border-color-style-in-spreadsheet-programmatically) – Rafa Guillermo May 10 '21 at 07:18

1 Answers1

0

Just in case:

function remove_left_bottom_and_inner_borders(range) {
  // top, left, bottom, right, vertical, horizontal
  range.setBorder(null, false, false, null, false, false);
}

Elaborated answer is here: Set border color & style in spreadsheet programmatically

Documentation is here: https://developers.google.com/apps-script/reference/spreadsheet/range#setBorder(Boolean,Boolean,Boolean,Boolean,Boolean,Boolean)

All you need is to figure out the range for these two cells.

Yuri Khristich
  • 13,448
  • 2
  • 8
  • 23