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

Sets paragraph properties of the paragraph in which the caret is positioned.

When there is a selection, paragraph properties of the selected paragraphs are set.


Parameters:

NameTypeDescription
actionNameString'addParagraphProperties' paragraph properties setting API
propertiesObject

{  id: {String}, className: {String}, style: {Object} }


Example:

editor.execCommand('addParagraphProperties', { id: 'paragraph-id' }); // id 
editor.execCommand('addParagraphProperties', { className: 'custom-class-name' }); // class 
editor.execCommand('addParagraphProperties', { style: { margin: { top: 20, left: 20 } } }); // margin 
editor.execCommand('addParagraphProperties', { style: { padding: { bottom: 30, right: 30 } } }); // padding
  • No labels