【发布时间】:2020-05-08 05:33:49
【问题描述】:
我正在尝试将材料表列分为两部分,但它不起作用。我试图为特定数据应用自定义 css,但再次无法正常工作。这是我的代码。
<MaterialTable
title=""
columns={[
{
title: "SCENARIO",
field: "scenario",
customSort: (a, b) => a.scenario.length - b.scenario.length,
},
{
title: "SCORE",
field: "score",
type: "numeric",
cellStyle: {
backgroundColor: "#e1f5f8",
color: "#000",
borderRight: "2px solid #000",
fontWeight: "bold",
},
},
{ title: "FILL RATE", field: "fillRate", type: "numeric" },
{
title: "REVENUE",
field: "revenue",
type: "numeric",
},
{ title: "COST TO SERVE", field: "costToServe", type: "numeric" },
{ title: "MARGIN", field: "margin", type: "numeric" },
{
title: "IMPACTED DEMAND",
field: "impactedDemand",
type: "numeric",
},
]}
data={[
{
scenario: "Live -04-25-2020",
score: 7.6,
fillRate: 97.5,
revenue: 63,
costToServe: 0,
margin: 6.9,
impactedDemand: 0,
},
{
scenario: "Live",
score: 7.0,
fillRate: 92.5,
revenue: 63,
costToServe: 0,
margin: 6.9,
impactedDemand: 0,
},
{
scenario: "Recomended",
score: 7.1,
fillRate: 97.5,
revenue: 63,
costToServe: 0,
margin: 6.9,
impactedDemand: 0,
},
{
scenario: "Override",
score: 7.0,
fillRate: 97.5,
revenue: 63,
costToServe: 0,
margin: 6.9,
impactedDemand: 0,
},
{
scenario: "ML",
score: 6.9,
fillRate: 97.5,
revenue: 63,
costToServe: 0,
margin: 6.9,
impactedDemand: 0,
},
]}
options={{
sorting: true,
search: false,
paging: false,
fixedColumns: {
left: 2,
},
}}
/>
如何将特定列数据分成两部分并在该列上应用 css ?请帮助我,因为我是材料表的新手。
【问题讨论】:
标签: reactjs material-ui material-table