You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
833 B
44 lines
833 B
import React from 'react';
|
|
import { Table } from 'antd';
|
|
import type { ColumnsType } from 'antd/es/table';
|
|
|
|
interface DataType {
|
|
key: React.Key;
|
|
name: string;
|
|
age: number;
|
|
address: string;
|
|
}
|
|
|
|
const columns: ColumnsType<DataType> = [
|
|
{
|
|
title: 'Name (all screens)',
|
|
dataIndex: 'name',
|
|
key: 'name',
|
|
render: (text) => <a>{text}</a>,
|
|
},
|
|
{
|
|
title: 'Age (medium screen or bigger)',
|
|
dataIndex: 'age',
|
|
key: 'age',
|
|
responsive: ['md'],
|
|
},
|
|
{
|
|
title: 'Address (large screen or bigger)',
|
|
dataIndex: 'address',
|
|
key: 'address',
|
|
responsive: ['lg'],
|
|
},
|
|
];
|
|
|
|
const data: DataType[] = [
|
|
{
|
|
key: '1',
|
|
name: 'John Brown',
|
|
age: 32,
|
|
address: 'New York No. 1 Lake Park',
|
|
},
|
|
];
|
|
|
|
const App: React.FC = () => <Table columns={columns} dataSource={data} />;
|
|
|
|
export default App;
|
|
|