【问题标题】:Remove default padding from Ant design table从 Ant 设计表中删除默认填充
【发布时间】:2022-01-17 23:53:11
【问题描述】:

https://ant.design/components/table/

  • 我想从 ant 设计表中删除默认的内边距和边距。
  • 我放了小尺寸的表格,但还不够,我仍然看到我想删除额外的 16 像素边距和填充。
  • 问题是当我调用类并重置边距时,它不起作用,这可能是什么原因?

我正在使用 ant design 4.17 和 react v17

这是我尝试过的,但它不起作用。

.ant-table-tbody{
  padding: 0;
}
.ant-table-tbody > tr > td{
  padding: 0;
}

【问题讨论】:

    标签: css reactjs antd


    【解决方案1】:

    您可以在 node_modules 文件夹中找到这些类名。节点模块/antd/es。然后,您发现 index.css 文件列出了所有可编辑的类名和属性。 要么 你可以使用

    .ant-table-tbody{
      padding: 0 !important;
    }
    .ant-table-tbody > tr > td{
      padding: 0 !important;
    }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-23
      • 2020-06-11
      • 1970-01-01
      • 2015-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多