title: In HTML or JavaScript, display sum of columns and rows in a table in the table
body: <p>I have an html table where users can enter values into the table. How can I display the totals of each column and row as well as the total of the totals in the table?</p>
  <pre><code> &lt;table&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;input value = &quot;0&quot;&gt;&lt;/input&gt;
        &lt;/td&gt;
        &lt;td&gt;
           &lt;input value = &quot;0&quot;&gt;&lt;/input&gt;
        &lt;/td&gt;
        &lt;td&gt;
           Total:
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           &lt;input value = &quot;0&quot;&gt;&lt;/input&gt;
        &lt;/td&gt;
        &lt;td&gt;
           &lt;input value = &quot;0&quot;&gt;&lt;/input&gt;
        &lt;/td&gt;
        &lt;td&gt;
           Total:
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;
           Total:
        &lt;/td&gt;
        &lt;td&gt;
           Total:
        &lt;/td&gt;
        &lt;td&gt;
           Total:
        &lt;/td&gt;
     &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>