UNPKG

1 kBJavaScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5import TablePropertyCommand from './tablepropertycommand';
6/**
7 * The table alignment command.
8 *
9 * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
10 * the `'tableAlignment'` editor command.
11 *
12 * To change the alignment of the selected table, execute the command:
13 *
14 * ```ts
15 * editor.execute( 'tableAlignment', {
16 * value: 'right'
17 * } );
18 * ```
19 */
20export default class TableAlignmentCommand extends TablePropertyCommand {
21 /**
22 * Creates a new `TableAlignmentCommand` instance.
23 *
24 * @param editor An editor in which this command will be used.
25 * @param defaultValue The default value for the "alignment" attribute.
26 */
27 constructor(editor, defaultValue) {
28 super(editor, 'tableAlignment', defaultValue);
29 }
30}