Skip to content

Commit 9e6439b

Browse files
committed
fix title and footer height according to Table[size]
1 parent 92d77e4 commit 9e6439b

File tree

4 files changed

+40
-17
lines changed

4 files changed

+40
-17
lines changed

components/table/demo/dynamic-settings.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Demo extends React.Component {
7575
title,
7676
footer,
7777
rowSelection: {},
78-
scroll,
78+
scroll: undefined,
7979
}
8080

8181
handleToggle = (prop) => {
@@ -124,19 +124,19 @@ class Demo extends React.Component {
124124
<Switch checked={state.pagination} onChange={this.handleToggle('pagination')} />
125125
</FormItem>
126126
<FormItem label="Title">
127-
<Switch defaultChecked onChange={this.handleTitleChange} />
127+
<Switch checked={!!state.title} onChange={this.handleTitleChange} />
128128
</FormItem>
129129
<FormItem label="Footer">
130-
<Switch defaultChecked onChange={this.handleFooterChange} />
130+
<Switch checked={!!state.footer} onChange={this.handleFooterChange} />
131131
</FormItem>
132132
<FormItem label="Expandable">
133-
<Switch defaultChecked onChange={this.handleExpandChange} />
133+
<Switch checked={!!state.expandedRowRender} onChange={this.handleExpandChange} />
134134
</FormItem>
135-
<FormItem defaultChecked label="Checkbox">
136-
<Switch onChange={this.handleRowSelectionChange} />
135+
<FormItem label="Checkbox">
136+
<Switch checked={!!state.rowSelection} onChange={this.handleRowSelectionChange} />
137137
</FormItem>
138138
<FormItem label="Fixed Header">
139-
<Switch defaultChecked onChange={this.handleScollChange} />
139+
<Switch checked={!!state.scroll} onChange={this.handleScollChange} />
140140
</FormItem>
141141
<FormItem label="Size">
142142
<Radio.Group size="default" value={state.size} onChange={this.handleSizeChange}>

components/table/demo/size.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const data = [{
4545

4646
ReactDOM.render(
4747
<div>
48-
<h4>No. Form (Middle size table)</h4>
48+
<h4>Middle size table</h4>
4949
<Table columns={columns} dataSource={data} size="middle" />
5050
<h4>Small size table</h4>
5151
<Table columns={columns} dataSource={data} size="small" />

components/table/style/index.less

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,17 @@
6868
&-footer {
6969
padding: 16px 8px;
7070
background: @table-head-background-color;
71-
position: relative;
72-
z-index: 2;
73-
top: -1px;
7471
border-radius: 0 0 @border-radius-base @border-radius-base;
72+
position: relative;
73+
&:before {
74+
content: '';
75+
height: 1px;
76+
background: @table-head-background-color;
77+
position: absolute;
78+
top: -1px;
79+
width: 100%;
80+
left: 0;
81+
}
7582
}
7683

7784
&.@{table-prefix-cls}-bordered &-footer {
@@ -157,6 +164,11 @@
157164
.@{table-prefix-cls}-tbody > tr > td {
158165
padding: 10px 8px;
159166
}
167+
168+
.@{table-prefix-cls}-title,
169+
.@{table-prefix-cls}-footer {
170+
padding: 10px 8px;
171+
}
160172
}
161173

162174
&-small {
@@ -170,7 +182,6 @@
170182
}
171183

172184
.@{table-prefix-cls}-thead > tr > th {
173-
padding: 10px 8px;
174185
background: #fff;
175186
border-bottom: 1px solid @border-color-split;
176187
}
@@ -179,6 +190,17 @@
179190
padding: 6px 8px;
180191
}
181192

193+
.@{table-prefix-cls}-title,
194+
.@{table-prefix-cls}-footer,
195+
.@{table-prefix-cls}-thead > tr > th {
196+
padding: 10px 8px;
197+
}
198+
199+
.@{table-prefix-cls}-title {
200+
border-bottom: 1px solid @border-color-split;
201+
top: 0;
202+
}
203+
182204
.@{table-prefix-cls}-header {
183205
background: #fff;
184206
table {
@@ -192,11 +214,6 @@
192214
.@{table-prefix-cls}-row:last-child td {
193215
border-bottom: 0;
194216
}
195-
196-
.@{table-prefix-cls}-title,
197-
.@{table-prefix-cls}-footer {
198-
top: 0;
199-
}
200217
}
201218

202219
&-column-sorter {
@@ -279,11 +296,14 @@
279296
}
280297

281298
&.@{table-prefix-cls}-small {
299+
border-right: 0;
300+
282301
.@{table-prefix-cls}-header > table,
283302
.@{table-prefix-cls}-body > table,
284303
.@{table-prefix-cls}-fixed-left table,
285304
.@{table-prefix-cls}-fixed-right table {
286305
border: 0;
306+
padding: 0;
287307
}
288308

289309
.@{table-prefix-cls}-title {

site/theme/static/demo.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
.code-box:target {
4444
border: 1px solid rgba(45, 183, 245, 0.7);
4545
box-shadow: 0 0 4px rgba(45, 183, 245, 0.5);
46+
z-index: 10;
47+
background: #fff;
48+
position: relative;
4649
}
4750

4851
.code-box {

0 commit comments

Comments
 (0)