Search code examples
reactjsantdant-design-pro

How to disable freezed table column in Ant design Tables


I wanted to keep horizontal scroll bar but don't want the freezed columns (full Name, Age & action) how to do that ? please help

 <Table
    columns={columns}
    dataSource={data}
    scroll={{
      x: 1300,
    }}
  />

codesandbox.io/s/36gkp0?file=/demo.js


Solution

  • To remove the freezing, delete the fixed property from objects in columns array. Commented here for illustration -

    {
        title: "Full Name",
        width: 100,
        dataIndex: "name",
        key: "name"
        // fixed: 'left', // delete
      },
      {
        title: "Age",
        width: 100,
        dataIndex: "age",
        key: "age",
        // fixed: "left" // delete
      },
    

    Edit Fixed Columns - antd@4.21.2 (forked)