scrollX

Since: DataTables 1.10

Horizontal scrolling.

Description

Enable horizontal scrolling. When a table is too wide to fit into a certain layout, or you have a large number of columns in the table, you can enable horizontal (x) scrolling to show the table in a viewport, which can be scrolled.

This property can be true which will allow the table to scroll horizontally when needed (recommended), or any CSS unit, or a number (in which case it will be treated as a pixel measurement).

Type

boolean

Description:
  • false - No horizontal scrolling
  • true - Enable horizontal scrolling in the table

Default

  • Value: false

Example

Enable horizontal scrolling:

$('#example').dataTable( {
  "scrollX": true
} );

Related

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