123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import React from "react";
- import { Table } from "antd";
- import styled from 'styled-components'
- const DataTable = styled.div`
- .table-style {
- .ant-table-thead {
- > tr {
- > th {
- background: #e3eefd !important;
- }
- }
- }
- }
- `
- export default function DataTableStruct() {
- const columns = [
- {
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- },
- {
- title: '字段',
- dataIndex: 'field',
- key: 'field',
- },
- {
- title: '类型',
- dataIndex: 'type',
- key: 'type',
- },
- {
- title: '长度',
- dataIndex: 'length',
- key: 'length',
- },
- ]
- const data = [
- {
- key: 1,
- id: 1,
- field: 'SCHED_NAME',
- type: 'VARCHAR(120)',
- length: 120
- },
- {
- key: 2,
- id: 2,
- field: 'SCHED_NAME',
- type: 'VARCHAR(120)',
- length: 120
- },
- {
- key: 3,
- id: 3,
- field: 'SCHED_NAME',
- type: 'VARCHAR(120)',
- length: 120
- },
- ]
- return (
- <DataTable>
- <Table columns={columns} dataSource={data} className={'table-style'} />
- </DataTable>
- )
- }
|