copyHtml5 button not showing (using CDN)
copyHtml5 button not showing (using CDN)
vincentwhales
Posts: 2Questions: 2Answers: 0
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/v/bs/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-html5-1.4.2/datatables.min.css"/>
</head>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
</tbody>
</table>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-html5-1.4.2/datatables.min.js"></script>
<script>
$(document).ready(function() {
$('#example').DataTable({
buttons: [
'copyHtml5',
]
});
});
</script>
</body>
</html>
I am unable to see any copyHtml5 button being shown. Pretty much all the answers asked previously involves reordering the importing of js library files.
Now that I am using the CDN method from the official site, why am I not able to see the Copy HTML5 button?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Looks like you are using Bootstrap. You will need to add the buttons as shown in this example:
https://datatables.net/extensions/buttons/examples/styling/bootstrap.html
Kevin