小编Qui*_*vas的帖子

自定义DataTable按钮的外观

今天是个好日子.

我最近使用ASP.Net(MVC 4)处理Web应用程序,并发现了一种非常令人印象深刻的HTML表格,它使用了Datatable.

我能够使用所述表格的搜索元素内联创建默认按钮,但我的问题是它们的外观非常简单,我一直在阅读它的文档,但我无法找到一种方法来改变它们的外观,特别是它们的背景图像.

提前致谢

这是我的表格代码.

    <table id="exampledatatable" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" >
        <thead>
            <tr>
                <th>Customer Code</th>
                <th>Customer Name</th>
                <th>Customer Type</th>
                <th>Industry Type</th>
                <th>Website</th>
                <th>Email</th>
                <th>Off Day 1</th>
                <th>Off Day 2</th>
                <th>E-mail</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Tiger</td>
                <td>Nixon</td>
                <td>System Architect</td>
                <td>Edinburgh</td>
                <td>61</td>
                <td>2011/04/25</td>
                <td>$320,800</td>
                <td>5421</td>
                <td>t.nixon@datatables.net</td>
                <td>
                    @Html.ActionLink("Edit", "UpdateCompany") |
                    @Html.ActionLink("Delete", "DeleteCompany") |
                    @Html.ActionLink("Restore", "RestoreCompany")
                </td>
            </tr>
       </tbody>
    </table>
Run Code Online (Sandbox Code Playgroud)

这是我生成按钮的代码

<script>

        $(document).ready(function () {
            $('#exampledatatable').DataTable({
                dom: 'Bfrtip',
                buttons: [
                    {
                        extend: 'copyHtml5',
                        text: '<h4 style="font-size: 13px;"><i class="fa …
Run Code Online (Sandbox Code Playgroud)

asp.net jquery datatables asp.net-mvc-4

1
推荐指数
3
解决办法
1万
查看次数

标签 统计

asp.net ×1

asp.net-mvc-4 ×1

datatables ×1

jquery ×1