title: Jquery- calculate average of column "values" and put it in each td of another column
body: <p>Let's say i have a table like this:</p>
  
  <pre><code>&lt;table cellpadding="0" cellspacing="0" border="0" class="display" id="selection"&gt;
      &lt;th&gt;Values&lt;/th&gt;
      &lt;th&gt;Average&lt;/th&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;5&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;   
          &lt;tr&gt;
              &lt;td&gt;0.9&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;  
          &lt;tr&gt;
              &lt;td&gt;2&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;  
          &lt;tr&gt;
              &lt;td&gt;6&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;       
          &lt;/tr&gt;  
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to calculate average of column "values" and put it in each td of the average column using Jquery. The result shoud be like this picture:</p>
  
  <p><img src="https://i.stack.imgur.com/Pm3qs.png" alt="enter image description here"></p>
  
  <p>Please note that i filter results in the table with a search box and the number of rows will change each time the user searches. </p>