CSS问题Ngx-table angular2泳道

我目前遇到的问题是让ngx-datatable拥有正确的css.我在我的css文件中有这个导入正确的CSS.
@import '@swimlane/ngx-datatable/release/index.css';
@import '@swimlane/ngx-datatable/release/themes/material.css';
@import '@swimlane/ngx-datatable/release/assets/icons.css';

它似乎只做了它想做的事情的一半.这是我的html调用库的部分.

<ngx-datatable  class="material striped"
    class="material"
    [rows]="rows"
    [columns]="columns"
    [columnMode]="'force'"
    [headerHeight]="50"
    [footerHeight]="50"
    [rowHeight]="100">
  </ngx-datatable>

如果有人知道为什么会这样,那将非常有帮助.

@amcdnl任何线索,如果你读到这个,很抱歉打扰你

CSS Issue

解决方法

我认为它与视图封装有关.基本上你的css将使用像[_ngcontent-c5]这样的属性,因为模板里面的元素会自动拥有它.

但是,由数据表添加到dom的项目可能没有该属性导致样式不执行任何操作.

你可以通过向你的组件添加选项封装:ViewEncapsulation.None来解决这个问题:

import { ViewEncapsulation } from '@angular/core';
@Component({
  [...] // other code like template and style urls
  encapsulation: ViewEncapsulation.None
})

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效