内联样式 table 行 w/ React

Inline style table row w/ React

我有此方法返回 table 行,我正在尝试为每一行添加背景颜色

 collateRedditResuls() {
        return this.state.items.map(function (item, index) {


            return (
                <tr style={{'bgcolor':'#ffa500'}} key={ uuid()}>
                    <td>{item.title}</td>
                    <td> {item.description}</td>
                    <td><img src={item.image}/></td>
                </tr>
            )
        });
    }

出于某种原因,此技术不起作用,table 背景仍然没有着色 - 有人知道为什么吗?

您需要输入完整的 CSS 属性 姓名:

{{ 'backgroundColor': '#ffa500' }}