File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 17
17
function ( newValue , oldValue ) {
18
18
if ( newValue === true ) {
19
19
// reset display styles so column widths are correct when measured below
20
- $elem . find ( 'thead, tbody' ) . css ( 'display' , '' ) ;
20
+ $elem . find ( 'thead, tbody, tfoot ' ) . css ( 'display' , '' ) ;
21
21
22
22
// wrap in $timeout to give table a chance to finish rendering
23
23
$timeout ( function ( ) {
24
24
// set widths of columns
25
25
$elem . find ( 'th' ) . each ( function ( i , thElem ) {
26
26
thElem = $ ( thElem ) ;
27
27
var tdElems = $elem . find ( 'tbody tr:first td:nth-child(' + ( i + 1 ) + ')' ) ;
28
+ var tfElems = $elem . find ( 'tfoot tr:first td:nth-child(' + ( i + 1 ) + ')' ) ;
28
29
29
30
var columnWidth = tdElems . width ( ) ;
30
31
thElem . width ( columnWidth ) ;
31
32
tdElems . width ( columnWidth ) ;
33
+ tfElems . width ( columnWidth ) ;
32
34
} ) ;
33
35
34
36
// set css styles on thead and tbody
35
- $elem . find ( 'thead' ) . css ( {
37
+ $elem . find ( 'thead, tfoot ' ) . css ( {
36
38
'display' : 'block' ,
37
39
} ) ;
38
40
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " angu-fixed-header-table" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"authors" : [
5
5
" Jason Watmore <jason@pointblankdevelopment.com.au> (http://jasonwatmore.com)"
6
6
],
Original file line number Diff line number Diff line change 25
25
< td > Row {{item}} Col 4</ td >
26
26
</ tr >
27
27
</ tbody >
28
+ < tfoot >
29
+ < tr >
30
+ < td > Footer 1</ td >
31
+ < td > Footer 2</ td >
32
+ < td > Footer 3</ td >
33
+ < td > Footer 4</ td >
34
+ </ tr >
35
+ </ tfoot >
28
36
</ table >
29
37
30
38
< script src ="http://code.jquery.com/jquery-2.0.3.min.js "> </ script >
You can’t perform that action at this time.
0 commit comments