Print all tr in table
Print all tr in table
robertnicjoo
Posts: 2Questions: 1Answers: 0
I used to have <tfoot>
but when I hit print it didn't become include print view so I decided to move my table footer tr into <tbody>
to get print view but somehow still I cant get my tr
's into my print view except first one
<tbody>
//first tr (include print view)
<tr>
<td>xxxxxx</td>
</tr>
//second tr (not included print view)
<tr>
<td>xxxx</td>
</tr>
//third tr (not included print view)
<tr>
<td>xxxxxxxxxxx</td>
</tr>
</tbody>
here is my java code:
<script type="text/javascript">
$(document).ready(function() {
$('table.print').DataTable( {
dom: 'Bfrtip',
paging: false,
bFilter: false,
ordering: false,
searching: false,
bInfo: false,
buttons: {
buttons: [
{
extend: 'print',
text: '<i class="fa fa-print"></i> print',
titleAttr: 'print',
className: 'btn-theme02 btn-sm',
title: '',
customize: function ( win ) {
$(win.document.body)
.css( 'font-size', '10pt' )
$(win.document.body).find( 'table' )
.addClass( 'compact' )
.css( 'font-size', 'inherit')
.css( 'width', '550px' )
.css( 'text-align', 'center' );
$(win.document.body).find( 'table, th, td' )
.css( 'border-color', 'green' );
$(win.document.body).find( 'table, th' )
.css( 'color', 'green' )
.css( 'text-align', 'center' );
$(win.document.body).find( 'table, td' )
.css( 'color', 'black' );
}
}
]
}
});
table.buttons().container()
.appendTo( '#example_wrapper .col-sm-6:eq(0)' );
});
</script>
This discussion has been closed.
Answers
anyone here to answer?