Set table properties of the table in which the caret or selection is positioned.
Parameters:
| Name | Type | Description |
|---|---|---|
| actionName | String | 'setTableProperites' table properties setting API |
| properties | Object | { style: {Object}, caption: {Object}, head: {Object}, ..} |
Example:
// Set table caption
editor.execCommand('setTableProperties', {
caption: {
position: 'top', // 'none', 'top', 'bottom'
text: '표의 제목'
}
});
// Set table header
editor.execCommand('setTableProperties', {
head: {
scope: false,
value: 'row' // 'none', 'row', 'col', 'both'
}
});
// Set table border style
editor.execCommand('setTableProperties', {
style: {
border: {
style: 'dotted', // 'solid', 'dotted', 'dashed', 'double'
width: 10, // 단위 px
color: { r: 255, g: 0, b: 0 }
}
}
});
// Set table width and height
editor.execCommand('setTableProperties', {
style: {
width: { value: 800, unit: 'px' },
height: { value: 300, unit: 'px' }
}
});
// Set table align
editor.execCommand('setTableProperties', {
style: {
blockAlign: 'center' // 'left', 'center', 'right'
}
});
// Set table other properties
editor.execCommand('setTableProperties', {
style: {
tableLayout: 'auto', // 'auto', 'fixed'
display: 'table' // 'table', 'inline-table'
}
});