html - 数据表空表文本对齐其他设备上的更改

标签 html css datatables

我使用数据表已经有一段时间了,我遇到了这个问题:我更改了如下表的空表文本:

language: { emptyTable: "No Requests"}

在计算机上左对齐,但从平板电脑或手机上查看的相同文本变为居中对齐。 我尝试添加类似的内容:

language: { emptyTable: "No Requests", sClass: 'emptyT' }

和我的 CSS 类:

.emptyT {
    text-align:left;
}

但空表格的文本对齐方式保持不变(在计算机上左侧,但在平板电脑和手机上居中)。 有没有办法让它保持左对齐,无论使用的设备类型如何?

最佳答案

SOLUTION

添加以下 CSS 规则:

table.dataTable td.dataTables_empty {
    text-align: left;    
}

DEMO

参见this jsFiddle用于代码和演示。

关于html - 数据表空表文本对齐其他设备上的更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33121938/

相关文章:

html - 悬停 a-tag 时移动 div

javascript - 使用数据表进行非表布局

jquery - 将 jQuery dataTables 与使用 tmpl 的 ajax 回调生成的表结合使用

JavaScript 跳过验证表单

jquery - 无法使用 Bourbon Refills

html - 将两个重叠的盒子水平和垂直居中放置

JavaScript 数据表 : remove unwanted horizontal scrolling

html - 制作一个包含适合所有分辨率的图像的框

html - 将背景移到左侧 css

html - 为什么我的CSS交错?