configureAsXhtmlTableElements

How to get configureAsXhtmlTableElements

import configureAsXhtmlTableElements from 'fontoxml-table-flow-xhtml/src/configureAsXhtmlTableElements.js'

Type: Function

Configure XHTML tables.

Note that the columnBefore widget area can only be used if your tables use col elements, i.e., when shouldCreateColumnSpecificationNodes is set to true.

Example usage for the table widgets:

configureAsXhtmlTableElements(sxModule, {
	table: {
		namespaceURI: 'http://docbook.org/ns/docbook',
		tableFilterSelector: 'self::table and not(tgroup)'
	},
	td: {
		defaultTextContainer: 'simpara'
	}
	columnBefore: [
		createIconWidget('clock-o', {
			clickOperation: 'lcTime-value-edit',
			tooltipContent: 'Click here to edit the duration'
		})
	],
	rowBefore: [
		createIconWidget('dot-circle-o', {
			clickOperation: 'do-nothing'
		})
	],
	showInsertionWidget: true,
	showHighlightingWidget: true
});

The cell element menu button widgets are added based on the existence of contextual operations on cell level. Make sure that only cell-specific operations are added to the cell widget, so that users are only given options relevant to them. Example on how you can add this element menu on the widget:

configureProperties(sxModule, 'self::td', {
	contextualOperations: [
		{ name: 'contextual-set-total-cell', hideIn: ['context-menu'] }
	]
});

Arguments

# Name Type Description
1. sxModule Object
2. [options] Object
  Members

Members

Name Type Description
[columnBefore] Array<Widget> | Null

To add column icon widgets by using createIconWidget. Column widgets are linked to the col elements. Tables that do not have these elements will not show columnBefore widgets. Any widget can be added but only icon widget is supported.

[priority] Number

Selector priority for all elements configured by this function

[rowBefore] Array<Widget> | Null

To add row icon widgets by using createIconWidget. Row widgets are linked to the row elements of the table. Any widget can be added but only icon widget is supported.

shouldCreateColumnSpecificationNodes Boolean

Set to true if the table should include <col> elements by default


  Default value
false
[showHighlightingWidget] Boolean

To add highlighting bars which highlight columns and rows, and provide operations popover, default false.

[showInsertionWidget] Boolean

To add insertion buttons which insert a column or a row to a specific place, default false.

[table] Object

Options for the table element

  Members

Members

Name Type Description
namespaceURI String

The namespace URI for this table


  Default value
""
[tableFilterSelector] XPathTest

An optional additional selector for the table which will be used to refine whether a table element should be considered as an xhtml table

[td] Object

Configuration options for the td element

  Members

Members

Name Type Description
[defaultTextContainer] String

The default text container for the td element

[th] Object

Configuration options for the th element

  Members

Members

Name Type Description
[defaultTextContainer] String

The default text container for the th element

useBorders Boolean

Set to false if the borders attribute should not be used


  Default value
true
useDefaultContextMenu Boolean

Whether or not to use a preconfigured context menu for elements within the table


  Default value
true
[useTbody] Boolean

Set to true if tbody should be used

[useTh] Boolean

Set to true if th should be used

[useThead] Boolean

Set to true if thead should be used

Was this page helpful?