<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html-wide" table-class="display nowrap" order="2">

<css lib="datatables responsive">
	div.container { max-width: 1200px }
</css>
<js lib="jquery datatables responsive">
<![CDATA[

$(document).ready(function() {
	$('#example').DataTable( {
		responsive: true,
		columnDefs: [
			{ responsivePriority: 1, targets: 0 },
			{ responsivePriority: 2, targets: -2 }
		]
	} );
} );

]]>
</js>

<title lib="Responsive">Column priority</title>

<info><![CDATA[

Responsive will automatically hide columns from the right-hand-side of the table, moving in as the table gets smaller, but it can often be useful to use a custom ordering, giving priority to certain columns (for example an actions buttons column, or a column with important information).

Column visibility priority can be defined in Responsive using the `r-init columns.responsivePriority` initialisation option in the DataTables column options (`dt-init columns` or `dt-init columnDefs`). The priority given is a number with lower values representing a higher priority.

This example shows the _first name_ column being given top priority and then the _extn._ column. Resizing the table will cause the other columns to be removed before these two columns - with the _first name_ column finally taking priority.

The column priority can also be defined by a `data-priority` attribute on the column's header cell (for example `-tag <th data-priority="1">First name</th>`).

]]></info>

</dt-example>

