angularag-grid-angular

How do I add vertical grid lines to an ag-Grid?


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.


Solution

  • 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