转换单元格时,停止FooTable从<td>标签中删除html

BG9*_*911 1 html javascript jquery footable

我正在使用FooTable(http://fooplugins.github.io/FooTable/docs/getting-started.html)从我的静态html表创建一些动态表.

在表格的单元格或标签内是html格式化单元格中的值.例如,我在一个单元格中使用bootstraps标签组件.

我遇到的问题是,当footable运行时,它会转换所有html格式,并且似乎从单元格中删除所有这些html标签,而我只是留下了文本.

例如,我可能在一个单元格中:

<td><span class="label label-default">Default</span></td>
Run Code Online (Sandbox Code Playgroud)

转换为:

<td>Default</td>
Run Code Online (Sandbox Code Playgroud)

我的问题是有一个选项可以阻止这种情况发生吗?我搜索谷歌和可用的文档,但我没有运气.

似乎没有很多人遇到过这个问题.但肯定有人知道它是否可能.

Dan*_*ehl 5

您可以尝试将列标识为HTML,data-type="html"在包含HTML的列中使用.

例:

            <table id="testTable" class="table" data-paging="true">
            <thead>
                <tr>
                    <th style="width: 45%">Origin</th>
                    <th data-breakpoints="sm xs" style="width: 45%">Destination</th>
                    <th style="width: 5%" data-type="html">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>O1</td>
                    <td>D1</td>
                    <td><span class="glyphicon glyphicon-remove"></span>&nbsp;<span class="glyphicon glyphicon-pencil"></span></td>
                </tr>
                <tr>
                    <td>O2</td>
                    <td>D2</td>
                    <td><span class="glyphicon glyphicon-remove"></span>&nbsp;<span class="glyphicon glyphicon-pencil"></span></td>
                </tr>
                <tr>
                    <td>O3</td>
                    <td>D3</td>
                    <td><span class="glyphicon glyphicon-remove"></span>&nbsp;<span class="glyphicon glyphicon-pencil"></span></td>
                </tr>
            </tbody>
        </table>
Run Code Online (Sandbox Code Playgroud)

使用Javascript:

$("#testTable").footable();
Run Code Online (Sandbox Code Playgroud)