Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tfootが2行である場合の対応例
  • Loading branch information
jun68ykt committed Aug 17, 2019
1 parent 93ef6ec commit 48cae4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions index.html
Expand Up @@ -426,6 +426,10 @@
<th colspan="4" style="text-align:right">Total:</th>
<th></th>
</tr>
<tr>
<th colspan="4" style="text-align:right">Grand Total:</th>
<th></th>
</tr>
</tfoot>
</table>
</body>
Expand Down
9 changes: 6 additions & 3 deletions script.js
Expand Up @@ -28,9 +28,12 @@ $(document).ready(function() {
}, 0 );

// Update footer
$( api.column( 4 ).footer() ).html(
'$'+pageTotal +' ( $'+ total +' total)'
);
$(api.table().footer())
.find('th:nth-of-type(2)')
.each(function(index) {
var amount = index === 0 ? pageTotal : total;
$(this).text(`$${amount.toLocaleString('en-US')}`);
});
}
} );
} );

0 comments on commit 48cae4c

Please sign in to comment.