How to use rowspan and colspan in tbody using datatable.js?
Right now, datatables do not support rowspan or colspan to the table body.
But, the possible solution should be
DataTables hidden row details example
Hope it works.
可以使用<span></span><br>来实现换行,如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <td>{{ item.Owt }}</td> <td><a target= < "_blank" href= "{{ item.Tag|slink }}" >{{ item.Tag }}</a></td> <td><a class = "tooltip-info" style= "cursor:pointer;" data-toggle= "tooltip" data-placement= "top" title= "{{ item.RD_admin|tip_lines }}" >{{ item.RD_admin|first_owner }}</a></td> <td style= "text-align: right;" >{{ item.Rank }}</td> <td style= "text-align: right;" > {% set list1 = item.Hosts.split( ',' ) %} {% for list in list1 %} <span>{{ list }}</span><br> {% endfor %} {# {% for host in item.Hosts %}#} ###这种的会按字符迭代 {# <span>{{host}}</span><br>#} {# {% endfor %}#} </td> <td style= "text-align: right;" >{{ item.HostNumber }}</td> {# <td style= "text-align: right;" >{{ item.DomainConfigAlarmItemsNum }}</td>#} {# <td style= "text-align: right;" >{% if item.DomainConfigAlarmItemsNum == 0 %}0{% else %}{{(item.DomainConfigAlarmItemsNum/item.DomainItemsTotal* 100) |round(2) }}%{% endif %}</td>#} </tr> |
效果
做有积累的事~~
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步