Note that there are some explanatory texts on larger screens.

plurals
  1. POGet the table cells value row by row with jquery
    primarykey
    data
    text
    <p>I have a table like this</p> <pre><code>&lt;table class="wp-list-table widefat fixed posts"&gt; &lt;tbody id="c_b"&gt; &lt;tr&gt; &lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Upcharge&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Profit Percentage&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Short Description&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="4"&gt;&lt;input type="checkbox" id="selectall"&gt; Bulk &lt;u&gt;Check/Uncheck&lt;/u&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="title_1"&gt;&lt;input type="checkbox" id="product_1" value="123123_1" class="case"&gt; 123123&lt;br&gt;&lt;/td&gt; &lt;td id="upcharge_1"&gt;24&lt;/td&gt; &lt;td id="percentage_1"&gt;15&lt;/td&gt; &lt;td id="sdescription_1"&gt;This is a short&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="title_2"&gt;&lt;input type="checkbox" id="product_2" value="A33232_2" class="case"&gt; A33232&lt;br&gt;&lt;/td&gt; &lt;td id="upcharge_2"&gt;24&lt;/td&gt; &lt;td id="percentage_2"&gt;15&lt;/td&gt; &lt;td id="sdescription_2"&gt;This is a short&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="title_22"&gt;&lt;input type="checkbox" id="product_3" value="BEY-049_22" class="case"&gt; Plane Shirt&lt;br&gt;&lt;/td&gt; &lt;td id="upcharge_22"&gt;24&lt;/td&gt; &lt;td id="percentage_22"&gt;15&lt;/td&gt; &lt;td id="sdescription_22"&gt;SD for Plane shirt&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="title_23"&gt;&lt;input type="checkbox" id="product_4" value="IRCTC_23" class="case"&gt; Rail Neer&lt;br&gt;&lt;/td&gt; &lt;td id="upcharge_23"&gt;24&lt;/td&gt; &lt;td id="percentage_23"&gt;15&lt;/td&gt; &lt;td id="sdescription_23"&gt;Rail neer short description&lt;/td&gt; &lt;/tr&gt; &lt;input type="hidden" value="47474" id="licence_no" name="licence_no"&gt;&lt;input type="hidden" value="47474" id="licence_no" name="licence_no"&gt; &lt;input type="hidden" value="47474" id="licence_no" name="licence_no"&gt;&lt;input type="hidden" value="47474" id="licence_no" name="licence_no"&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I want to get the cells value row by row as an array, for this I write the code like below</p> <pre><code>$("tbody&gt;tr").each(function(){ var rowvalue = []; $("tbody&gt;tr&gt;td").each(function(){ //alert($(this).text()); rowvalue.push($(this).text()); }); alert(rowvalue); }); </code></pre> <p>Here I am geting the all values at a time and it is alerting n times (n= number of row), but I want n number of array with that rows value. How can I get those value.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload