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 {
77 classes : String ,
88 headers : Vec < String > ,
99 rows : Vec < Component > ,
10+ footers : Vec < Component > ,
1011}
1112
1213impl Table {
@@ -15,8 +16,14 @@ impl Table {
1516 headers : headers. iter ( ) . map ( |h| h. to_string ( ) ) . collect ( ) ,
1617 classes : "table table-sm" . into ( ) ,
1718 rows : rows. to_vec ( ) ,
19+ footers : vec ! [ ] ,
1820 }
1921 }
22+
23+ pub fn footers ( mut self , footer : Vec < Component > ) -> Self {
24+ self . footers = footer;
25+ self
26+ }
2027}
2128
2229component ! ( Table ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ table.table.table-sm {
1111 background : transparent ;
1212 text-transform : uppercase ;
1313 font-size : 12px ;
14- padding : 12px 12px 12px 0 ;
14+ padding : 12px 12px 12px 0.25 rem ;
1515 border-bottom : 1px solid #{$gray-600 } ;
1616 font-weight : #{$font-weight-semibold } ;
1717 }
@@ -28,6 +28,18 @@ table.table.table-sm {
2828 }
2929 }
3030
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+
3143 border-collapse : separate ;
3244 border-spacing : 0 12px ;
3345}
Original file line number Diff line number Diff line change 1111 < %+ row %>
1212 < % } %>
1313 </ 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+ < % } %>
1423</ table >
You can’t perform that action at this time.
0 commit comments