javascript - Reduce whitespace between columns in a chakra Table - Stack Overflow

I'm creating a basic small Table in chakra-ui, however the whitespace between columns is too much

I'm creating a basic small Table in chakra-ui, however the whitespace between columns is too much for my particular use case. I've set size="sm" but it's still too much whitespace.

How can we achieve this? Here's a summary snippet of pseudo-code corresponding to my problem:

<Table size="sm">
  <Thead>
    // ...
  </Thead>
  <Tbody>
    //...
  </Tbody>
</Table>

Here's the full worked example in codesandbox: =/src/ResponsiveTable.tsx:196-344

I'm creating a basic small Table in chakra-ui, however the whitespace between columns is too much for my particular use case. I've set size="sm" but it's still too much whitespace.

How can we achieve this? Here's a summary snippet of pseudo-code corresponding to my problem:

<Table size="sm">
  <Thead>
    // ...
  </Thead>
  <Tbody>
    //...
  </Tbody>
</Table>

Here's the full worked example in codesandbox: https://codesandbox.io/s/responsive-table-forked-ut904?file=/src/ResponsiveTable.tsx:196-344

Share Improve this question asked Jul 24, 2021 at 3:54 ABCABC 7831 gold badge12 silver badges28 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You just to add css to override css of Table:

<Table size="small" className="table-tiny" />

and in css:

.table-tiny th,
.table-tiny td {
  padding-left: 4px;
  padding-right: 4px;
}

https://codesandbox.io/s/responsive-table-forked-8683s?file=/src/ResponsiveTable.tsx

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744866620a4598014.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信