【问题标题】:How to configure text bold for certain column in react tabulator如何在反应制表器中为某些列配置粗体文本
【发布时间】:2020-07-07 16:03:14
【问题描述】:

我正在为我的应用程序使用 react-tabulator: https://www.npmjs.com/package/react-tabulator

我想将其中一列格式化为粗体文本。 我试过格式化程序:“粗体”

columns = () =>{
    return (
      [
        { title: "Title", field: "title1", headerSort: false, width: 180, formatter:"bold",  hozAlign: "right"  },
      ]}

我尝试在列中添加一个 cssClass

columns = () =>{
    return (
      [
        { title: "Title", field: "title1", headerSort: false, width: 180, cssClass: 'data-header,  hozAlign: "right"  },
      ]}

在styles.css中定义类 .data-header { font-weight: "bold" }

没有任何作用。 是否也可以在 react-tabulator 中设置特定行的样式? 感谢所有专家的帮助。

【问题讨论】:

    标签: reactjs tabulator


    【解决方案1】:

    我找到了解决方案,只是为了他人的利益。 我需要使用以下内容配置 styles.css 才能使 cssCass 工作:

    .tabulator .data-header { 
      background-color: #ccc;
      font-weight: bold;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多