adjust style

This commit is contained in:
zombiej 2018-09-17 14:36:26 +08:00 committed by 偏右
parent 50dc59e1ce
commit 048a9020f3
3 changed files with 28 additions and 6 deletions

View File

@ -80,6 +80,7 @@ class Demo extends React.Component {
footer,
rowSelection: {},
scroll: undefined,
hasData: true,
}
handleToggle = (prop) => {
@ -116,6 +117,10 @@ class Demo extends React.Component {
this.setState({ scroll: enable ? scroll : undefined });
}
handleDataChange = (hasData) => {
this.setState({ hasData });
}
handlePaginationChange = (e) => {
const { value } = e.target;
this.setState({
@ -153,6 +158,9 @@ class Demo extends React.Component {
<FormItem label="Fixed Header">
<Switch checked={!!state.scroll} onChange={this.handleScollChange} />
</FormItem>
<FormItem label="Has Data">
<Switch checked={!!state.hasData} onChange={this.handleDataChange} />
</FormItem>
<FormItem label="Size">
<Radio.Group size="default" value={state.size} onChange={this.handleSizeChange}>
<Radio.Button value="default">Default</Radio.Button>
@ -173,7 +181,7 @@ class Demo extends React.Component {
</FormItem>
</Form>
</div>
<Table {...this.state} columns={columns} dataSource={data} />
<Table {...this.state} columns={columns} dataSource={state.hasData ? data : null} />
</div>
);
}

View File

@ -300,6 +300,8 @@
.@{table-prefix-cls}-fixed-left table,
.@{table-prefix-cls}-fixed-right table {
border: @border-width-base @border-style-base @border-color-split;
border-right: 0;
border-bottom: 0;
}
&.@{table-prefix-cls}-empty {
@ -310,10 +312,23 @@
}
&.@{table-prefix-cls}-fixed-header {
.@{table-prefix-cls}-header > table {
border-bottom: 0;
}
.@{table-prefix-cls}-body > table {
border-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.@{table-prefix-cls}-body-inner > table {
border-top: 0;
}
.@{table-prefix-cls}-placeholder {
border: 0;
}
}
.@{table-prefix-cls}-thead > tr:not(:last-child) > th {

View File

@ -22,13 +22,8 @@
.@{table-prefix-cls}-small {
border: @border-width-base @border-style-base @border-color-split;
padding: 0 @table-padding-horizontal/2;
border-radius: @border-radius-base;
&.@{table-prefix-cls}-fixed-header {
padding: 0;
}
> .@{table-prefix-cls}-title,
> .@{table-prefix-cls}-footer {
padding: @table-padding-vertical/2 @table-padding-horizontal/2;
@ -40,6 +35,10 @@
}
> .@{table-prefix-cls}-content {
> .@{table-prefix-cls}-body {
margin: 0 @table-padding-horizontal/2;
}
> .@{table-prefix-cls}-header > table,
> .@{table-prefix-cls}-body > table,
> .@{table-prefix-cls}-scroll > .@{table-prefix-cls}-header > table,