public/javascripts/yui/datatable/datatable.js
function(row, range) {
    // Default values stripe all rows
    var allRows = this._elTbody.rows,
        nStartIndex = 0,
        nEndIndex = allRows.length,
        aOdds = [], nOddIdx = 0,
        aEvens = [], nEvenIdx = 0;

    // Stripe a subset
    if((row !== null) && (row !== undefined)) {
        // Validate given start row
        var elStartRow = this.getTrEl(row);
        if(elStartRow) {
            nStartIndex = elStartRow.sectionRowIndex;

            // Validate given range
            if(lang.isNumber(range) && (range > 1)) {
                nEndIndex = nStartIndex + range;
            }
        }
    }

    for(var i=nStartIndex; i<nEndIndex; i++) {
        if(i%2) {
            aOdds[nOddIdx++] = allRows[i];
        } else {
            aEvens[nEvenIdx++] = allRows[i];
        }
    }

    if (aOdds.length) {
        Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
    }

    if (aEvens.length) {
        Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
    }
}
function(row, range) {
    // Default values stripe all rows
    var allRows = this._elTbody.rows,
        nStartIndex = 0,
        nEndIndex = allRows.length,
        aOdds = [], nOddIdx = 0,
        aEvens = [], nEvenIdx = 0;

    // Stripe a subset
    if((row !== null) && (row !== undefined)) {
        // Validate given start row
        var elStartRow = this.getTrEl(row);
        if(elStartRow) {
            nStartIndex = elStartRow.sectionRowIndex;

            // Validate given range
            if(lang.isNumber(range) && (range > 1)) {
                nEndIndex = nStartIndex + range;
            }
        }
    }

    for(var i=nStartIndex; i<nEndIndex; i++) {
        if(i%2) {
            aOdds[nOddIdx++] = allRows[i];
        } else {
            aEvens[nEvenIdx++] = allRows[i];
        }
    }

    if (aOdds.length) {
        Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
    }

    if (aEvens.length) {
        Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
    }
}
function ( row , range ) { // Default values stripe all rows var allRows = this . _elTbody . rows , nStartIndex = 0 , nEndIndex = allRows . length , aOdds = [ ] , nOddIdx = 0 , aEvens = [ ] , nEvenIdx = 0 ; // Stripe a subset if ( ( row !== null ) && ( row !== undefined ) ) { // Validate given start row var elStartRow = this . getTrEl ( row ) ; if ( elStartRow ) { nStartIndex = elStartRow . sectionRowIndex ; // Validate given range if ( lang . isNumber ( range ) && ( range > 1 ) ) { nEndIndex = nStartIndex + range ; } } } for ( var i = nStartIndex ; i < nEndIndex ; i ++ ) { if ( i % 2 ) { aOdds [ nOddIdx ++ ] = allRows [ i ] ; } else { aEvens [ nEvenIdx ++ ] = allRows [ i ] ; } } if ( aOdds . length ) { Dom . replaceClass ( aOdds , DT . CLASS_EVEN , DT . CLASS_ODD ) ; } if ( aEvens . length ) { Dom . replaceClass ( aEvens , DT . CLASS_ODD , DT . CLASS_EVEN ) ; } }
Assigns the classes DT.CLASS_EVEN and DT.CLASS_ODD to one, many, or all TR elements.

@method _setRowStripes
@param row {HTMLElement | String | Number} (optional) HTML TR element reference
or string ID, or page row index of where to start striping.
@param range {Number} (optional) If given, how many rows to stripe, otherwise
stripe all the rows until the end.
@private
Assigns the classes DT . CLASS_EVEN and DT . CLASS_ODD to one many or all TR elements .