# BorderStyle

{% tabs %}
{% tab title="💾 程式" %}

```javascript
// 畫框線的設定
function BorderStyle(
  {
    top        = null,
    left       = null, 
    bottom     = null, 
    right      = null, 
    vertical   = null, 
    horizontal = null, 
    color      = 'black', 
    style      = SpreadsheetApp.BorderStyle.SOLID
  }={}
) {

  // edges
  this.edge = {
    top   : top,
    left  : left,
    bottom: bottom,
    right : right
  };

  // internalBorder
  this.internalBorder = {
    vertical  : vertical,
    horizontal: horizontal
  };

  // color
  this.color = color;

  // style
  this.style = style;
}



```

{% endtab %}

{% tab title="🔸 特定屬性" %}
⬆️ 需要： [app](https://lochiwei.gitbook.io/web/appendix/gas/app "mention") (app.style)

```javascript
// 🔸 BorderStyle.allThin()
BorderStyle.allThin = function(){
  return new BorderStyle({
    top:true, bottom:true, 
    left:true, right:true,
    vertical:true, horizontal:true
  });
};

// 🔸 BorderStyle.thickTopBottom()
BorderStyle.thickTopBottom = function(){
  return new BorderStyle({
    top   : true, 
    bottom: true, 
    style : app.style.border.solidMedium  // app.style
  });
};

// 🔸 BorderStyle.thinBottom()
BorderStyle.thinBottom = function(){
  return new BorderStyle({bottom: true});
};
```

{% endtab %}

{% tab title="⬇️ 應用" %}

* [app.setborder](https://lochiwei.gitbook.io/web/appendix/gas/app/member/app.setborder "mention")
  {% endtab %}
  {% endtabs %}
