Since: DataTables 2.0

Get the width of a column.


This method is a helper method to get the width of the column in a table. It can be used by extension authors who need to utalise the width of a column (for example the Buttons extension uses widths for the Excel and PDF export).

The result given is the "outer width" of the cells for the target column. If a column is hidden, is width will be returned as 0.

The returned number might not be an integer, depending on the browser's table rendering.


function column().width()


Compute the width of a column as it is shown.


The width of the column in pixels.


Get the width for a column that was clicked on:

let table = new DataTable('#example');

table.on('click', 'tbody td', function () {
	let width = table.column(this).width();

	alert('Column width: ' + width);


The following options are directly related and may also be useful in your application development.