当我试图在下面的代码中添加colSpan="2"属性时,出现了错误"Type string is not assignable to type number".我该怎么解决这个问题?
class ProductCategoryRow extends React.Component<MyProps, MyState> {
constructor(props: MyProps) {
super(props);
}
render() {
return (<div>
<tr><th colSpan="2">{ this.props.category }</th></tr>
</div>);
} //end render.
} //end class.