Page tree
Skip to end of metadata
Go to start of metadata

Set cell properties of the cell in which the caret or selection is positioned.


Parameters:

NameTypeDescription
actionNameString'setCellProperties' cell properties setting API
propertiesObject

{ border: {Object}, style: {Object}, tableHead: {Object} }


Example:

// Set cell border style
editor.execCommand('setCellProperties', {
	border: {
		style: 'dotted', // 'solid', 'dotted', 'dashed', 'double'
		width: 5, // 단위 px
		color: { r: 0, g: 0, b: 255 },
		select: [true, true, true, true, true, true] // top, middle, bottom, left, center, right
	}
});

// Set cell to table header
editor.execCommand('setCellProperties', {
	tableHead: {
		scope: 'none', // 'none', 'row', 'col'
		tagName: 'th' // 'th', 'td'
	}
});

// Set cell background color
editor.execCommand('setCellProperties', {
	style: {
		backgroundColor: { r: 255, g: 0, b: 0 }
	}
});

// Set vertical align of cell
editor.execCommand('setCellProperties', {
	style: {
		verticalAlign: 'middle' // 'top', 'middle', 'bottom'
	}
});

// Set horizontal align of cell
editor.execCommand('setCellProperties', {
	style: {
		align: 'right' // 'left', 'center', 'right', 'justify'
	}
});
  • No labels