title: Finding column index using jQuery when table contains column-spanning cells
body: <p>Using jQuery, how can I find the column index of an arbitrary table cell in the example table below, such that cells spanning multiple columns have multiple indexes?</p>
  
  <h1>HTML</h1>
  
  <pre><code>&lt;table&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;One&lt;/td&gt;
        &lt;td&gt;Two&lt;/td&gt;
        &lt;td id="example1"&gt;Three&lt;/td&gt;
        &lt;td&gt;Four&lt;/td&gt;
        &lt;td&gt;Five&lt;/td&gt;
        &lt;td&gt;Six&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td colspan="2"&gt;One&lt;/td&gt;
        &lt;td colspan="2"&gt;Two&lt;/td&gt;
        &lt;td colspan="2" id="example2"&gt;Three&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;One&lt;/td&gt;
        &lt;td&gt;Two&lt;/td&gt;
        &lt;td&gt;Three&lt;/td&gt;
        &lt;td&gt;Four&lt;/td&gt;
        &lt;td&gt;Five&lt;/td&gt;
        &lt;td&gt;Six&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <h1>jQuery</h1>
  
  <pre><code>var cell = $("#example1");
  var example1ColIndex = cell.parent("tr").children().index(cell);
  // == 2. This is fine.
  
  cell = $("#example2");
  var example2ColumnIndex = cell.parent("tr").children().index(cell);
  // == 2. It should be 4 (or 5, but I only need the lowest). How can I do this?
  </code></pre>