find the <td> column value of respective cell using any javascript library
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table border="1"&gt;
  &lt;tr&gt;
    &lt;td rowspan="3"&gt;0&lt;/td&gt;
    &lt;td&gt;1&lt;/td&gt;
    &lt;td rowspan="3"&gt;2&lt;/td&gt;
    &lt;td&gt;3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;A&lt;/td&gt;
    &lt;td&gt;B&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;X&lt;/td&gt;
    &lt;td&gt;Y&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;</code></pre>
</div>
</div>
</p>

<p>I want to find the column number of <strong>td</strong> containing X using jQuery or some other JavaScript library.</p>

<p>For example column number of <strong>td</strong> containing <strong>A</strong> is <strong>1</strong> and <strong>B</strong> is <strong>3</strong>.</p>

<p>Also we know that column number of <strong>td</strong> containing <strong>X</strong> is <strong>1</strong>. But  how can we get that pragmatically.</p>

<p>My case here is I need to merge data of all the rows with first row. So while moving through each <strong>td</strong> I need to know from which column does it belong so that I can merge it to the <strong>td</strong> of first row of that column.
Please help me if there is any other approach to solve my problem.</p>