{hero}

columns.ariaTitle

自:DataTables 1.10.25 起

設定欄位的 aria-label 屬性值。

描述

此選項可用於為欄標頭的 aria-label 屬性提供自訂字串,以增強螢幕閱讀器的可訪問性。預設情況下,DataTables 將使用現有的 aria-label 屬性或欄標題 (columns.title,或從文件中讀取),但此選項提供了自訂功能。

請注意,如果使用者可以排序欄位,則此處給定的值將附加 language.aria.sortAscendinglanguage.aria.sortDescending,以向螢幕閱讀器使用者指示情況。

類型

此選項可以以下列類型給定

預設值

預設使用 columns.title

範例

使用 columnDefs 設定第一欄的 aria-label

new DataTable('#myTable', {
	columnDefs: [
		{
			ariaTitle: 'Screenreader title',
			targets: 0
		}
	]
});

使用 columns 設定第一欄的 aria-label

new DataTable('#myTable', {
	columns: [{ title: 'Screenreader title' }, null, null, null, null]
});

相關

以下選項直接相關,也可能在您的應用程式開發中很有用。