Blame view

src/styles/components/table.less 4.3 KB
744eb0af   梁灏   update Table comp...
1
2
3
  @table-prefix-cls: ~"@{css-prefix}table";
  
  .@{table-prefix-cls} {
0d136465   梁灏   update Table
4
      width: 100%;
744eb0af   梁灏   update Table comp...
5
      max-width: 100%;
0d136465   梁灏   update Table
6
      overflow: hidden;
744eb0af   梁灏   update Table comp...
7
8
      color: @text-color;
      font-size: @font-size-small;
0d136465   梁灏   update Table
9
10
11
      background-color: #fff;
      border: 1px solid @border-color-base;
      border-bottom: 0;
a3547c1b   梁灏   update Table
12
      border-right: 0;
3ef4dfb9   梁灏   update Table
13
      //border-collapse: collapse;
0d136465   梁灏   update Table
14
15
      box-sizing: border-box;
      position: relative;
744eb0af   梁灏   update Table comp...
16
  
a3547c1b   梁灏   update Table
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
      &:before{
          content: '';
          width: 100%;
          height: 1px;
          position: absolute;
          left: 0;
          bottom: 0;
          background-color: @border-color-base;
          z-index: 1;
      }
  
      &:after{
          content: '';
          width: 1px;
          height: 100%;
          position: absolute;
          top: 0;
          right: 0;
          background-color: @border-color-base;
          z-index: 1;
      }
  
e7e8c8ff   梁灏   update Table
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
      &-with-header{
          border-radius: @border-radius-base @border-radius-base 0 0;
      }
  
      &-with-footer{
          border: 1px solid @border-color-base;
          border-radius: 0 0 @border-radius-base @border-radius-base;
      }
  
      &-with-header&-with-footer{
          border-radius: @border-radius-base;
      }
  
      &-title, &-footer{
          height: 48px;
          line-height: 48px;
          border-bottom: 1px solid @border-color-split;
      }
      &-footer{
          border-bottom: none;
      }
  
192e2cb8   梁灏   update Table
61
62
63
      &-header{
          overflow: hidden;
      }
e7e8c8ff   梁灏   update Table
64
      &-body{
a3547c1b   梁灏   update Table
65
          overflow: auto;
e7e8c8ff   梁灏   update Table
66
67
68
          position: relative;
      }
  
e7e8c8ff   梁灏   update Table
69
70
71
72
73
74
75
76
77
      &-with-fixed-top&-with-footer{
          .@{table-prefix-cls}-footer{
              border-top: 1px solid @border-color-base;
          }
          tbody tr:last-child td{
              border-bottom: none;
          }
      }
  
0d136465   梁灏   update Table
78
79
80
81
82
83
84
85
86
87
      th, td
      {
          min-width: 0;
          height: 48px;
          box-sizing: border-box;
          text-align: left;
          text-overflow: ellipsis;
          vertical-align: middle;
          position: relative;
          border-bottom: 1px solid @border-color-split;
744eb0af   梁灏   update Table comp...
88
89
      }
  
0d136465   梁灏   update Table
90
91
      th {
          height: 40px;
744eb0af   梁灏   update Table comp...
92
93
          white-space: nowrap;
          overflow: hidden;
0d136465   梁灏   update Table
94
95
96
97
98
          background-color: @table-thead-bg;
      }
      td{
          background-color: #fff;
          transition: background-color @transition-time @ease-in-out;
744eb0af   梁灏   update Table comp...
99
100
      }
  
0d136465   梁灏   update Table
101
102
      th&-column,
      td&-column
744eb0af   梁灏   update Table comp...
103
      {
0d136465   梁灏   update Table
104
105
106
107
108
109
110
111
112
113
114
115
          &-left{
              text-align: left;
          }
          &-center{
              text-align: center;
          }
          &-right{
              text-align: right;
          }
      }
  
      & table{
a3547c1b   梁灏   update Table
116
117
          //width: 100%;
          table-layout: fixed;
0d136465   梁灏   update Table
118
119
120
121
122
123
124
125
126
127
      }
      &-border{
          th,td{
              border-right: 1px solid @border-color-split;
          }
      }
      &-cell{
          padding-left: 18px;
          padding-right: 18px;
          overflow: hidden;
744eb0af   梁灏   update Table comp...
128
          text-overflow: ellipsis;
0d136465   梁灏   update Table
129
130
131
132
          white-space: normal;
          word-break: break-all;
          box-sizing: border-box;
      }
3ef4dfb9   梁灏   update Table
133
134
135
      &-hidden{
          visibility: hidden;
      }
0d136465   梁灏   update Table
136
137
      th &-cell{
          display: inline-block;
744eb0af   梁灏   update Table comp...
138
          position: relative;
0d136465   梁灏   update Table
139
140
141
142
143
144
145
146
147
148
149
150
          word-wrap: normal;
          vertical-align: middle;
      }
  
      &-stripe &-body{
          tr:nth-child(2n) {
              td{
                  background-color: @table-td-stripe-bg;
              }
          }
      }
  
abdec99d   梁灏   update Table
151
      tr&-row-hover{
0d136465   梁灏   update Table
152
153
154
155
156
157
158
159
160
161
162
163
164
          td{
              background-color: @table-td-hover-bg;
          }
      }
  
      &-large {
          font-size: @font-size-base;
          th{
              height: 48px;
          }
          td{
              height: 60px;
          }
e7e8c8ff   梁灏   update Table
165
166
167
168
          &-title, &-footer{
              height: 60px;
              line-height: 60px;
          }
0d136465   梁灏   update Table
169
170
171
172
173
174
175
176
177
      }
  
      &-small{
          th{
              height: 32px;
          }
          td{
              height: 40px;
          }
e7e8c8ff   梁灏   update Table
178
179
180
181
          &-title, &-footer{
              height: 40px;
              line-height: 40px;
          }
0d136465   梁灏   update Table
182
183
184
      }
  
      &-row-highlight,
abdec99d   梁灏   update Table
185
      tr&-row-highlight&-row-hover,
0d136465   梁灏   update Table
186
187
188
189
190
      &-stripe &-body tr&-row-highlight:nth-child(2n)
      {
          td{
              background-color: @table-td-highlight-bg;
          }
744eb0af   梁灏   update Table comp...
191
      }
7f34c510   梁灏   update Table
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
  
      &-fixed, &-fixed-right{
          position: absolute;
          top: 0;
          left: 0;
          box-shadow: 1px 0 8px #d3d4d6;
          overflow-x: hidden;
  
          &::before {
              content: '';
              width: 100%;
              height: 1px;
              background-color: @border-color-base;
              position: absolute;
              left: 0;
              bottom: 0;
              z-index: 4;
          }
      }
      &-fixed-right{
          top: 0;
          left: auto;
          right: 0;
          box-shadow: -1px 0 8px #d3d4d6;
      }
744eb0af   梁灏   update Table comp...
217
  }