cssreactjsantd

Remove default padding from Ant design table


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

I am using ant design 4.17 and react v17

screenshot of the class I am trying to modify

This is what I tried but it does not work.

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

Solution

  • You can be found these className in the node_modules folder. node_modules/antd/es. Then, you found the index.css file lists out all of the classNames and attributes that are editable. or you can be use

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