資訊
自:DataTables 2.0 起
表格資訊顯示。
描述
此功能會在表格旁邊顯示一個文字元素,向最終使用者提供有關表格中顯示內容的資訊。當表格啟用分頁時,以及在搜尋時,此功能特別有用,可以為最終使用者提供表格中顯示內容以及可用內容的背景資訊。
可以使用 info
選項完全停用 info
功能,或將其從 layout
選項中排除(這是 DataTables 2 中偏好的方法)。
範例
使用預設佈局停用資訊顯示
new DataTable('#myTable', {
layout: {
bottomStart: null
}
});
在左上方顯示資訊顯示
new DataTable('#myTable', {
layout: {
topStart: 'info',
bottomStart: null
}
});
使用選項顯示資訊顯示
new DataTable('#myTable', {
layout: {
bottomStart: {
info: {
text: 'Table display: _START_ to _END_ of _TOTAL_ records'
}
}
}
});
相關
以下選項直接相關,也可能在您的應用程式開發中有所幫助。