# AlternateRows | tablefilter v0.5.3 API Document

    import {AlternateRows} from 'tablefilter/src/modules/alternateRows.js'

public class | source

# AlternateRows

#### Extends:

Feature → AlternateRows

Rows with alternating background color for improved readability

## Constructor Summary

Public Constructor
public | constructor (tf: Object) Creates an instance of AlternateRows. |

## Member Summary

Public Members
public | evenCss : String Css class for even rows (default: 'even') |
public | initialized : boolean |
public | oddCss : String Css class for odd rows (default: 'odd') |

## Method Summary

Public Methods
public | destroy () Removes all alternating backgrounds |
public | init () Sets alternating rows color |
public | processAll () Apply background to all valid rows |
public | processRow (rowIdx: Number, arrIdx: Number, isValid: Boolean) Set/remove row background based on row validation |

## Inherited Summary

From class Feature
public | config : Object TableFilter configuration |
public | emitter : Emitter TableFilter emitter instance |
public | enabled : Boolean TableFilter feature setting |
public | feature : String Feature name |
public | initialized : Boolean Field indicating whether Feature is initialized |
public | tf : TableFilter TableFilter instance |
public | destroy () Destroy the feature |
public | disable () Disable the feature |
public | enable () Enable the feature |
public | init () Initialize the feature |
public | isEnabled (): Boolean Indicate whether the feature is enabled or not |
public | reset () Reset the feature after being disabled |

## Public Constructors

### public constructor(tf: Object) source

Creates an instance of AlternateRows.

#### Override:

Feature#constructor

#### Params:

Name | Type | Attribute | Description
tf | Object |  | TableFilter instance

## Public Members

### public evenCss: String source

Css class for even rows (default: 'even')

### public initialized: boolean source

#### Override:

Feature#initialized

### public oddCss: String source

Css class for odd rows (default: 'odd')

## Public Methods

### public destroy() source

Removes all alternating backgrounds

#### Override:

Feature#destroy

### public init() source

Sets alternating rows color

#### Override:

Feature#init

### public processAll() source

Apply background to all valid rows

### public processRow(rowIdx: Number, arrIdx: Number, isValid: Boolean) source

Set/remove row background based on row validation

#### Params:

Name | Type | Attribute | Description
rowIdx | Number |  | Row index
arrIdx | Number |  | Array index
isValid | Boolean |  | Valid row flag