【发布时间】:2022-01-14 21:06:43
【问题描述】:
正如标题所示,我不完全确定解决方案,因为它非常棘手。我想设置某种颜色,因为它在我的程序的 UI 方面很重要,因为除了渲染(或只是运行一个循环)之外的颜色方案来决定每个单元格的颜色,并对我想要的单元格进行例外处理背景要红,要红。必须有一个更通用的方式,但对于我的生活,我似乎无法得到它。 TYIA 非常感谢任何正确方向的观点!
<Table variant="striped" colorScheme="gray">
<TableCaption>Imperial to metric conversion factors</TableCaption>
<Thead>
<Tr>
<Th>Time Frame</Th>
<Th>Base</Th>
<Th>Bills</Th>
<Th>With Bills</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td>inches</Td>
<Td>millimetres (mm)</Td>
<Td isNumeric background="darkred">25.4</Td> //THIS DOES NOT WORK!!
</Tr>
<Tr>
<Td>feet</Td>
<Td>centimetres (cm)</Td>
<Td isNumeric>30.48</Td>
</Tr>
<Tr>
<Td>yards</Td>
<Td>metres (m)</Td>
<Td isNumeric>0.91444</Td>
</Tr>
</Tbody>
<Tfoot>
<Tr>
<Th>To convert</Th>
<Th>into</Th>
<Th isNumeric>multiply by</Th>
</Tr>
</Tfoot>
</Table>
【问题讨论】:
标签: reactjs typescript html-table chakra-ui