cell()
Select a single cell from a table.
Description
Select an individual cell to work with from a DataTable, with its chained methods providing the ability to get / set the data in the cell, work with it node directly and other actions.
Note that this method selects a single cell. If the selectors provided resolve to multiple cells in this method, the result will be truncated to just a single cell - the first one found. If you need to work with multiple cells, the cells()
method is available with the same selection options.
The method has two forms, reflecting the fact the cells can be selected in multiple different ways as your implementation demands:
- Cell selector
- Cross product between row and column selectors
Types
function cell( [ modifier ] )
- Description:
Select a cell that matches the modifier
- Parameters:
Name Type Optional 1 modifier
Yes - default: Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
- Returns:
DataTables API instance with selected cell
function cell( cellSelector, [ modifier ] )
- Description:
Select the cell found by a cell selector
- Parameters:
Name Type Optional 1 cellSelector
No Cell selector.
2 modifier
Yes - default: Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
- Returns:
DataTables API instance with selected cell
function cell( rowSelector, columnSelector, [ modifier ] )
- Description:
Select the cell found from both row and column selectors
- Parameters:
Name Type Optional 1 rowSelector
No Row selector, used to specify which row the cell should be taken from.
2 columnSelector
No Column selector, used to specify which column the cell should be taken from.
3 modifier
Yes - default: Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
- Returns:
DataTables API instance with selected cell
Related
The following options are directly related and may also be useful in your application development.