After replicating the code from http://datatables.net/release-datatables/extensions/TableTools/examples/simple.html in my Visual Studio project,
I organized the files by saving two css files as style1.css
and style2.css
, along with three js files named script1.js
, script2.js
, and script3.js
.
Subsequently, I created a file called custom.js
where I included the following code:
$(document).ready(function() {
$('#example').DataTable( {
dom: 'T<"clear">lfrtip'
} );
} );
Finally, my index.html
was structured as follows:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style1.css" />
<link rel="stylesheet" type="text/css" href="style2.css" />
<script type="text/javascript" src="custom.js"></script>
<script type="text/javascript" src="script1.js"></script>
<script type="text/javascript" src="script2.js"></script>
<script type="text/javascript" src="script3.js"></script>
</head>
<body>
<!--inserted exact copy of html table-->
</body>
Despite following the instructions, the code does not seem to work properly.
- No formatting is applied
- The "copy", "csv"... buttons are not visible
How can I rearrange my files/code to make it functional? Any guidance would be greatly appreciated!