<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html" order="5">

<css lib="datatables buttons"/>
<js lib="jquery datatables buttons jszip pdfmake vfsfonts buttons-html5 buttons-colvis">
<![CDATA[

$(document).ready(function() {
	$('#example').DataTable( {
		dom: 'Bfrtip',
		buttons: [
			{
				extend: 'copyHtml5',
				exportOptions: {
					columns: [ 0, ':visible' ]
				}
			},
			{
				extend: 'excelHtml5',
				exportOptions: {
					columns: ':visible'
				}
			},
			{
				extend: 'pdfHtml5',
				exportOptions: {
					columns: [ 0, 1, 2, 5 ]
				}
			},
			'colvis'
		]
	} );
} );

]]>
</js>

<title lib="Buttons">Column selectors</title>

<info><![CDATA[

All of the data export buttons have a `exportOptions` option which can be used to specify information about what data should be exported and how. The options given for this parameter are passed directly to the `b-api buttons.exportData()` method to obtain the required data.

One of the most commonly used is the `columns` option which defines the columns that should be used as part of the export. This is given as a `dt-type column-selector`, making it simple to tell it if you want only visible columns, or a mix of the columns available.

In this example the copy button will export column index 0 and all visible columns, the Excel button will export only the visible columns and the PDF button will export column indexes 0, 1, 2 and 5 only.

Column visibility controls are also included so you can change the columns easily and see the effect of the export options.

]]></info>

</dt-example>

