JSFiddle - React, Tailwind, and code Playground

http://stackoverflow.com/questions/17027550/jquery-loop-throug-table-get-id-and-change-values-in-a-specific-column/

HTML

<table class="ms-viewtable">
    <thead id="xxx">
        <tr class="ms-viewheadertr">
            <th>header1</th>
            <th>header2</th>
        </tr>
    </thead>
    <tbody>
        <tr class="ms-itmHover" id="2,1,0">
            <td>cell11</td>
            <td>cell12</td>
        </tr>
        <tr class="ms-itmHover" id="2,2,0">
            <td>cell21</td>
            <td>cell22</td>
        </tr>
    </tbody>
</table>

<button onclick="go(1);">go</button>

JavaScript

function go(num){
    $('table.ms-viewtable').each(function(){
        $(this).find('tr').each(function(){
            var cells = $(this).children(); //all cells
            if (this.parentNode.nodeName == 'THEAD') {
                cells.eq(num).html('header row '+this.parentNode.id);
            } else { //"TBODY"
                cells.eq(num).html('body row '+this.id);
            }
        });
    });
}