2
votes

I am trying to add vertical grid lines to an ag-Grid for angular 2 (making it a bit more excel-like).

Do I need to make a custom theme (not use ag-theme-balham)?

Does anyone have an example?

Any help would be appreciated.

2

2 Answers

1
votes

Override the ag-grid value:

   .ag-cell
   {
      border-right-color: black;
      border-right-width: 1px ;
      border-right-style: solid ;
    }

for cells and for the header

 .ag-header-cell,  .ag-header-group-cell {
    border-right: 1px solid black;
  }
0
votes

One solution could be to style the cells by adding for example:

cellStyle: {border: '1px solid'}

Result:

enter image description here

Use this Stackblitz for your reference:

https://stackblitz.com/edit/ag-grid-bss-test-s5pxxc?file=app/app.component.ts

You can try to put different size for the border for better look & feel:

border: 'solid',
borderTopWidth: '0.5px',
borderRightWidth: '0.5px',
borderLeftWidth: '0.5px',
borderBottomWidth: '0.5px'

enter image description here