# AlternateRows | tablefilter v0.1.15 API Document

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

public class | source

# AlternateRows

#### Extends:

Feature → AlternateRows

## Constructor Summary

Public Constructor
public | constructor (tf: Object) Alternating rows color |

## Member Summary

Public Members
public | evenCss : * |
public | initialized : boolean |
public | oddCss : * |

## Method Summary

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

## Inherited Summary

From class Feature
public | config : * |
public | emitter : * |
public | enabled : * |
public | feature : * |
public | initialized : boolean |
public | tf : * |
public | destroy () |
public | disable () |
public | enable () |
public | init () |
public | isEnabled (): * |
public | reset () |

## Public Constructors

### public constructor(tf: Object) source

Alternating rows color

#### Override:

Feature#constructor

#### Params:

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

## Public Members

### public evenCss: * source

### public initialized: boolean source

#### Override:

Feature#initialized

### public oddCss: * source

## 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

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

Set/remove row background based on row validation

#### Params:

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

### public removeRowBg(idx: Number) source

Removes row background color

#### Params:

Name | Type | Attribute | Description
idx | Number |  | Row index

### public setRowBg(rowIdx: Number, idx: Number) source

Sets row background color

#### Params:

Name | Type | Attribute | Description
rowIdx | Number |  | Row index
idx | Number |  | Valid rows collection index needed to calculate bg color