From 9e6439b06cd099ab384a4a2f026f0def6e12bf23 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 15 Nov 2016 20:06:41 +0800 Subject: [PATCH] fix title and footer height according to Table[size] --- components/table/demo/dynamic-settings.md | 14 ++++----- components/table/demo/size.md | 2 +- components/table/style/index.less | 38 +++++++++++++++++------ site/theme/static/demo.less | 3 ++ 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/components/table/demo/dynamic-settings.md b/components/table/demo/dynamic-settings.md index 7d3268b367..bec6d6dd05 100644 --- a/components/table/demo/dynamic-settings.md +++ b/components/table/demo/dynamic-settings.md @@ -75,7 +75,7 @@ class Demo extends React.Component { title, footer, rowSelection: {}, - scroll, + scroll: undefined, } handleToggle = (prop) => { @@ -124,19 +124,19 @@ class Demo extends React.Component { - + - + - + - - + + - + diff --git a/components/table/demo/size.md b/components/table/demo/size.md index 881b25fdea..ec3bb8a586 100644 --- a/components/table/demo/size.md +++ b/components/table/demo/size.md @@ -45,7 +45,7 @@ const data = [{ ReactDOM.render(
-

No. Form (Middle size table)

+

Middle size table

Small size table

diff --git a/components/table/style/index.less b/components/table/style/index.less index 8af0d1b897..9cb42ace25 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -68,10 +68,17 @@ &-footer { padding: 16px 8px; background: @table-head-background-color; - position: relative; - z-index: 2; - top: -1px; border-radius: 0 0 @border-radius-base @border-radius-base; + position: relative; + &:before { + content: ''; + height: 1px; + background: @table-head-background-color; + position: absolute; + top: -1px; + width: 100%; + left: 0; + } } &.@{table-prefix-cls}-bordered &-footer { @@ -157,6 +164,11 @@ .@{table-prefix-cls}-tbody > tr > td { padding: 10px 8px; } + + .@{table-prefix-cls}-title, + .@{table-prefix-cls}-footer { + padding: 10px 8px; + } } &-small { @@ -170,7 +182,6 @@ } .@{table-prefix-cls}-thead > tr > th { - padding: 10px 8px; background: #fff; border-bottom: 1px solid @border-color-split; } @@ -179,6 +190,17 @@ padding: 6px 8px; } + .@{table-prefix-cls}-title, + .@{table-prefix-cls}-footer, + .@{table-prefix-cls}-thead > tr > th { + padding: 10px 8px; + } + + .@{table-prefix-cls}-title { + border-bottom: 1px solid @border-color-split; + top: 0; + } + .@{table-prefix-cls}-header { background: #fff; table { @@ -192,11 +214,6 @@ .@{table-prefix-cls}-row:last-child td { border-bottom: 0; } - - .@{table-prefix-cls}-title, - .@{table-prefix-cls}-footer { - top: 0; - } } &-column-sorter { @@ -279,11 +296,14 @@ } &.@{table-prefix-cls}-small { + border-right: 0; + .@{table-prefix-cls}-header > table, .@{table-prefix-cls}-body > table, .@{table-prefix-cls}-fixed-left table, .@{table-prefix-cls}-fixed-right table { border: 0; + padding: 0; } .@{table-prefix-cls}-title { diff --git a/site/theme/static/demo.less b/site/theme/static/demo.less index 4b3601965f..00a6cf638f 100644 --- a/site/theme/static/demo.less +++ b/site/theme/static/demo.less @@ -43,6 +43,9 @@ .code-box:target { border: 1px solid rgba(45, 183, 245, 0.7); box-shadow: 0 0 4px rgba(45, 183, 245, 0.5); + z-index: 10; + background: #fff; + position: relative; } .code-box {