UNPKG

1.38 kBJavaScriptView Raw
1/**
2 * @license Copyright (c) 2003-2024, 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 TableCellPropertyCommand from './tablecellpropertycommand.js';
6/**
7 * The table cell vertical alignment command.
8 *
9 * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as
10 * the `'tableCellVerticalAlignment'` editor command.
11 *
12 * To change the vertical text alignment of selected cells, execute the command:
13 *
14 * ```ts
15 * editor.execute( 'tableCellVerticalAlignment', {
16 * value: 'top'
17 * } );
18 * ```
19 *
20 * The following values, corresponding to the
21 * [`vertical-align` CSS attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align), are allowed:
22 *
23 * * `'top'`
24 * * `'bottom'`
25 *
26 * The `'middle'` value is the default one so there is no need to set it.
27 */
28export default class TableCellVerticalAlignmentCommand extends TableCellPropertyCommand {
29 /**
30 * Creates a new `TableCellVerticalAlignmentCommand` instance.
31 *
32 * @param editor An editor in which this command will be used.
33 * @param defaultValue The default value for the "alignment" attribute.
34 */
35 constructor(editor, defaultValue) {
36 super(editor, 'tableCellVerticalAlignment', defaultValue);
37 }
38}