---
title: "How to set the value for corresponding value in jquery data table"  
description: "How to set the value for corresponding value in jquery data table"  
author: "marcel ethan"  
published: 2013-02-13  
updated: 2013-02-13  
canonical: https://www.mindstick.com/forum/596/how-to-set-the-value-for-corresponding-value-in-jquery-data-table  
category: "ajax"  
tags: ["ajax"]  
reading_time: 1 minute  

---

# How to set the value for corresponding value in jquery data table

Hi MindStickians!

I create the mvc [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) data table. But when loading the scriopt its does not [match](https://www.mindstick.com/forum/159713/regex-match-attribute-in-an-html-code) the [table data](https://answers.mindstick.com/qa/114525/how-to-delete-rows-with-reference-table-data) and does not bind in my table row. My code is given

below.

$.ajax({ \
// my [passing value](https://www.mindstick.com/forum/1/problem-in-passing-value-from-one-page-to-other-page-in-asp-dot-net)\
[success](https://www.mindstick.com/articles/12957/best-tips-to-make-your-ghostwriting-experience-a-success): [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) (data) { // i get the data properly \
$('#Table').dataTable().fnClearTable();\
$.each(data, function (k, v) {\
var ID= v.ID;\
var name= v.name;\
var [batch](https://www.mindstick.com/forum/157604/explain-the-features-of-the-batch-operating-system-also-describe-the-pros-and-cons)= v.batch;

$('#Table').dataTable().fnAddData([\
ID,\
name,\
batch\
]);\
});\
}\
});

\
my table:

<table id="Table" width="100%">\
<thead>\
<tr>\
<th>EMP_ID</th>\
<th>EMP_name</th>\
<th>EMP_batch</th>\
</tr>\
</thead>\
<tbody></tbody>\
</table>

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

\

## Replies

### Reply by AVADHESH PATEL

Hi Marcel!

The key to you problem is the response of your AJAX request. Make sure that it's a proper JSON object composed of an array of objects.

Like this:

```
    {        "ID": 101,        "name": "Samual",        "batch": "A"    },    {        "ID": 102,        "name": "Denial",        "batch": "B"    }
```


---

Original Source: https://www.mindstick.com/forum/596/how-to-set-the-value-for-corresponding-value-in-jquery-data-table

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
