{hero}

間隔

自:Buttons 2.1.0 起

一個特殊的「按鈕」,可在按鈕之間提供視覺分組。
請注意 - 此屬性需要 DataTables 的 Buttons 擴充功能。

描述

此按鈕類型在 Buttons 中是獨一無二的,它實際上不顯示按鈕或任何最終使用者可以互動的內容。而是簡單地在按鈕之間引入一個空間,允許簡單的視覺分組。

因此,大多數選項(例如 actioninit 等)不適用於此按鈕。只有下面指定的選項可用。

選項

除了所有按鈕可用的選項(例如 buttons.buttons.text)之外,此按鈕還可以在其組態物件中設定以下選項來自訂其動作和顯示。

範例

在按鈕之間新增間隔

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['csv', 'excel', 'pdf', 'spacer', 'copy', 'print']
		}
	}
});

顯示橫條

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: [
				'csv',
				'excel',
				'pdf',
				{
					extend: 'spacer',
					style: 'bar'
				},
				'copy',
				'print'
			]
		}
	}
});