rows()

Since: DataTables 1.10

Select multiple rows from a table.

Description

Working with rows is a fundamental part of DataTables, and you want to be able to easily select the rows that you want from the table. This method is the rows counter part to the columns() and cells() methods for working with columns and cells in the table, respectively. Using a selector and the selector-modifier option the rows at the table can be obtained with this method's own chained methods providing the ability to get the data from the rows, the row nodes and to invalidate the data, among other actions.

While this rows() method provides access to multiple rows with a single call, its plural counterpart row() is used to select and manipulate a single row at a time, allowing finer gain control and additional methods not available in the plural method such as updating data and working with child rows.

The method has two forms, reflecting the fact the rows can be selected in multiple different ways as your implementation demands:

Types

function rows( [ modifier ] )

Description:

Select all rows

Parameters:
Returns:

DataTables API instance with selected rows

function rows( rowSelector [, modifier ] )

Description:

Select rows found by a row selector

Parameters:
Returns:

DataTables API instance with selected rows in the result set

Related

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