File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed
pgml-dashboard/src/components/tables/small/table Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ pub struct Table {
7
7
classes : String ,
8
8
headers : Vec < String > ,
9
9
rows : Vec < Component > ,
10
+ footers : Vec < Component > ,
10
11
}
11
12
12
13
impl Table {
@@ -15,8 +16,14 @@ impl Table {
15
16
headers : headers. iter ( ) . map ( |h| h. to_string ( ) ) . collect ( ) ,
16
17
classes : "table table-sm" . into ( ) ,
17
18
rows : rows. to_vec ( ) ,
19
+ footers : vec ! [ ] ,
18
20
}
19
21
}
22
+
23
+ pub fn footers ( mut self , footer : Vec < Component > ) -> Self {
24
+ self . footers = footer;
25
+ self
26
+ }
20
27
}
21
28
22
29
component ! ( Table ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ table.table.table-sm {
11
11
background : transparent ;
12
12
text-transform : uppercase ;
13
13
font-size : 12px ;
14
- padding : 12px 12px 12px 0 ;
14
+ padding : 12px 12px 12px 0.25 rem ;
15
15
border-bottom : 1px solid #{$gray-600 } ;
16
16
font-weight : #{$font-weight-semibold } ;
17
17
}
@@ -28,6 +28,18 @@ table.table.table-sm {
28
28
}
29
29
}
30
30
31
+ tfoot {
32
+ td {
33
+ color : #{$gray-300 } ;
34
+ background : transparent ;
35
+ text-transform : uppercase ;
36
+ font-size : 12px ;
37
+ padding : 12px 12px 0px .25rem ;
38
+ border-top : 1px solid #{$gray-600 } ;
39
+ font-weight : #{$font-weight-semibold } ;
40
+ }
41
+ }
42
+
31
43
border-collapse : separate ;
32
44
border-spacing : 0 12px ;
33
45
}
Original file line number Diff line number Diff line change 11
11
< %+ row %>
12
12
< % } %>
13
13
</ tbody >
14
+ < % if !footers.is_empty() {%>
15
+ < tfoot >
16
+ < tr >
17
+ < % for footer in footers { %>
18
+ < td > < %+ footer %> </ td >
19
+ < % } %>
20
+ </ tr >
21
+ </ tfoot >
22
+ < % } %>
14
23
</ table >
You can’t perform that action at this time.
0 commit comments