Changing db data with representative values with jquery

Changing db data with representative values with jquery

I have a simple table.

 
  1. <table class="tb">
  2. <tr><th>ColA</th><th>ColB</th><th>ColC</th></tr>
  3.  <tr><td>10</td><td>12,3</td><td>24,5</td></tr>
  4.  <tr><td>40,4</td><td> </td><td>5,5</td></tr>
  5. </table>

I would like to change the original mysql data with representative values that I assign to them.

So if there is a value in the first column, then they are all replaced with 1, if there is a value in column 2, then it is replaced with 2, if not, it is left blank, and it goes on like this.

Would it be possible to achieve this with jquery (easily)? or I better change the whole table in the db.

So the output table of the above table would look like this:

  1. <table class="tb">
  2. <tr><th>ColA</th><th>ColB</th><th>ColC</th></tr>
  3.  <tr><td>1</td><td>2</td><td>3</td></tr>
  4.  <tr><td>1</td><td> </td><td>3</td></tr>
  5. </table>