I am using jQuery DataTables in my project.
I am fetching data as JSON using ajax and initializing datatable using that, but if data column contains value as ABC XYZ
(Note there are 2 spaces between ABC and XYZ) multiple whitespaces are not preserved in rendered output.
JSP Code
<table id="marketViewStatusDT" class="display" style="cellspacing:0;width:100%;background-color: #ffffff;" >
<thead>
<tr>
<th style="width:12%;height:30px;" class="aleft">UTI</th>
<th style="width:5%;height:30px;" class="aleft">Source </th>
</tr>
</thead>
</table>
JS CODE
marketViewStatusDT = $("#marketViewStatusDT").DataTable( {
"sDom": '<"H"l<"toolbar">p>t<"F"ip>',
"bDestroy":true,
"bProcessing" : true,
"bServerSide" : true,
"bLenthChange" : false,
"bJQueryUI" : false,
"lengthMenu": [[20, 50, 100], [20, 50, 100]],
"bSort" : true,
"bFilter": false,
"bPaginate": true,
"bSearchable": true,
"pagingType": "full",
"scrollY": calcDataTableHeight(),
"scrollX": true,
"sAjaxSource" : "fetchData.html",
"aoColumns": [
{ "mData": "uti",},
{ "mData": "source",}
],
});