【问题标题】:How do I had vertical grid lines to an ag-Grid?如何将垂直网格线添加到 ag-Grid?
【发布时间】:2019-06-01 09:43:29
【问题描述】:

我正在尝试将垂直网格线添加到角度 2 的 ag-Grid(使其更像 excel)。

我需要制作自定义主题(不使用 ag-theme-balham)吗?

有人有例子吗?

任何帮助将不胜感激。

【问题讨论】:

    标签: angular ag-grid-angular


    【解决方案1】:

    覆盖 ag-grid 值:

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

    对于单元格 和标题

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

    【讨论】:

      【解决方案2】:

      一种解决方案可能是通过添加以下示例来设置单元格样式:

      cellStyle: {border: '1px solid'}
      

      结果:

      使用此 Stackblitz 供您参考:

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

      您可以尝试为边框设置不同的尺寸以获得更好的外观和感觉:

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

      【讨论】:

        猜你喜欢
        • 2019-11-04
        • 1970-01-01
        • 1970-01-01
        • 2021-12-28
        • 2020-09-28
        • 1970-01-01
        • 2021-02-03
        • 2016-03-13
        • 2017-12-27
        相关资源
        最近更新 更多