gpt4 book ai didi

datatables - 查看 Jquery DataTable 中的图片或图像

转载 作者:行者123 更新时间:2023-12-02 23:45:08 27 4
gpt4 key购买 nike

我可以知道是否可以将图片或图像放入数据表(http://datatables.net/)的行中,以及如何做到这一点?

最佳答案

是的,简单的方法(Jquery Datatable)

    <script>
$(document).ready(function () {
$('#example').dataTable({
"processing": true, // control the processing indicator.
"serverSide": true, // recommended to use serverSide when data is more than 10000 rows for performance reasons
"info": true, // control table information display field
"stateSave": true, //restore table state on page reload,
"lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "All"]], // use the first inner array as the page length values and the second inner array as the displayed options
"ajax":{
"url": "@string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"))/Home/AjaxGetJsonData",
"type": "GET"
},
"columns": [
{ "data": "Name", "orderable" : true },
{ "data": "Age", "orderable": false },
{ "data": "DoB", "orderable": true },
{
"render": function (data, type, JsonResultRow, meta) {
return '<img src="Content/Images/'+JsonResultRow.ImageSrcDB+'">';
}
}
],
"order": [[0, "asc"]]
});
});
</script>

enter image description here

关于datatables - 查看 Jquery DataTable 中的图片或图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8206419/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com