JSFiddle - React, Tailwind, and code Playground
HTML
<table id="my_table">
<thead>
<th>Supp</th>
<th>Report</th>
<th>Other</th>
</thead>
</table>
JavaScript
var suppCol, reportCol;
$("#my_table th").each(function() {
var $this = $(this), html = $this.html();
if(html == "Supp") suppCol = $this;
if(html == "Report") reportCol= $this;
});
alert(suppCol.html() + ", " + reportCol.html()); //Sanity check
suppCol = $("#my_table th").index(suppCol);
reportCol = $("#my_table th").index(reportCol);
alert(suppCol + ", " + reportCol); //Should have 0 and 1, right??