简体   繁体   English

将数据表的TD内容包装在span标签内

[英]Wrapping TD contents of datatable inside a span tag

am using data table and loading data from db using Ajax. 我正在使用数据表,并使用Ajax从数据库加载数据。 the data is getting loaded properly. 数据已正确加载。 but i want to enclose each context of TD inside a span tag like below 但我想将TD的每个上下文括在如下的span标签内

<td><span>cell content</span></td>

currently the output is coming as 目前的输出是

<td>cell content</td>

how do i do this? 我该怎么做呢? am using datatable and bootstrap. 我正在使用数据表和引导程序。

add this and it worked 添加它,它的工作

var id;
fnRender: function (oObj) {id = oObj.aData[0]
                       return '<span title="' + id + '">' + oObj.aData[0] + '</span>';
    } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM