Question: I am generating a table as shown in the image by dynamically creating HTML. I want to add some validations on selections and want to save the data as well. Is there any way to achieve the same with JQuery?

**EDIT**
Is it possible to do with JQuery DataTable?

![enter image description here](https://i.stack.imgur.com/w4Vse.png)

Answer: 
using below code u can get the each cell value of a selected row and then you can validate each value.

```
$(document).ready(function() {
$('#example td').live('click', function() {
var anOpen = [];
var nTr = this.parentNode;
var i = $.inArray(nTr, anOpen);
console.log(this); // clicked cell
console.log(nTr); // clicked row
$(this).parent().find("td").each(function() {
    console.log($(this).html()); // logs each cell value
});
});
});​

```

you can refer the link [here](http://datatables.net/examples/api/select_single_row.html) 

```
you have mentioned about saving. Is it saving to db?

```
**You can check here** [jquery-datatable-ajax-tutorial-with-example](http://mobisoftinfotech.com/resources/blog/web-programming/jquery-datatable-ajax-tutorial-with-example-project/) 

```
 var studentTable;

jQuery(document).ready(function() {

studentTable = jQuery(&#039;#studentListTable&#039;).dataTable({
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bRetrieve" : true,
"bFilter" : true,
"iDisplayLength": 10,
"bProcessing" : true,
"bServerSide" : false,
"aoColumns" : [ { "bSearchable" : false,"bVisible" : false,
"asSorting" : [ "asc" ] },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true }
]
});

jQuery(".ui-corner-br").addClass(&#039;ui-widget-header_custom &#039;);
});

```