Created
January 12, 2011 10:09
-
-
Save iksela/775967 to your computer and use it in GitHub Desktop.
This file will be used to overload some styles and format the print output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#tableID').dataTable({ | |
"bProcessing": true, | |
"bJQueryUI": true, | |
"sPaginationType": "full_numbers", | |
"sAjaxSource": 'ajax/datatables.php', | |
"oLanguage": { "sUrl": "../res/js/dataTables.fr.txt" }, | |
"sDom": '<"H"Tfr>t<"F"ip>', | |
"oTableTools": { | |
"sSwfPath": "../res/swf/copy_cvs_xls_pdf.swf", | |
"aButtons": [ | |
{ | |
"sExtends": "print", | |
"sButtonText": "Imprimer", | |
/* We add a click function to switch the media type of the print CSS, and add a listener on the Escape key to switch it back. */ | |
"fnClick": function() { | |
$('#css_print').attr('media', 'all'); | |
$(document).keydown(function(e){ | |
if (e.keyCode == 27) { | |
$('#css_print').attr('media', 'print'); | |
} | |
}); | |
} | |
}, | |
] | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- we set the media type to "print" for our special print CSS, and give it and ID. --> | |
<link rel="stylesheet" href="../res/css/print.css" type="text/css" media="print" id="css_print" /> | |
<!-- we set the media type of the DataTables css to "all" --> | |
<link rel="stylesheet" href="../res/css/demo_table_jui.css" type="text/css" media="all" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table { | |
width: 100%; | |
} | |
.DataTables_sort_wrapper { | |
font-weight: bold; | |
} | |
tr, td, th { | |
border: 1px solid #000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment