My editors would like the default indent, or tab size, to be about 8 characters. It seems the default is 2 characters?
Document Editor seems to have:
documentEditor.Selection.ParagraphFormat.SetFirstLineIndent(24);
(I assume 24 is pixels?)
How can I do something similar with the Rich Text Editor?
The toolbar indent doesn't indent; it adds a margin to the entire paragraph!
Thanks.
.e-richtexteditor .e-rte-content .e-content p:last-child, .e-richtexteditor .e-rte-content .e-content pre:last-child, .e-richtexteditor .e-rte-content .e-content blockquote:last-child, .e-richtexteditor .e-source-content .e-content p:last-child, .e-richtexteditor .e-source-content .e-content pre:last-child, .e-richtexteditor .e-source-content .e-content blockquote:last-child { text-indent: 20px; } |
Hi, thanks for your prompt response.
So far I have not been able to get this to work by adding the <style> to the bottom of my razor form, or by adding it a separate referenced css file.
I was able to get minimal functionality by using a different css class name with text-indent, and referencing it by using CssClass on the control.
I don't yet understand why I don't seem to be able to reference e-richtexteditor when everything I see so far, including the browser dev console, says I should.
Hi Charles,
We have validated your queries,
Query 1: “I have not been able to get this to work by adding the <style> to the bottom of my razor form, or by adding it to a separate referenced CSS file, and I don't yet understand why I don't seem to be able to reference `e-richtexteditor` when everything I see so far, including the browser dev console, says I should.”
We are not able to reproduce this issue on our end, can you please share us with the following details,
The above details will be helpful for us to validate the reported issue from our end and assist you at the earliest.
Query 2: “I was able to get minimal functionality by using a different CSS class name with text-indent and referencing it by using CssClass on the control.”
We are glad that you found this solution. We have also prepared a sample to add text indent to the first line using the class configured in the `CssClass` API,
Code Snippet:
|
<SfRichTextEditor CssClass="e-custom-class"> <RichTextEditorToolbarSettings Items="@Tools" /> <p>The Rich Text Editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content. Users can format their content using standard toolbar commands.</p> </SfRichTextEditor>
<style> .e-custom-class .e-rte-content .e-content p:first-child, .e-custom-class .e-rte-content .e-content pre:first-child, .e-custom-class .e-rte-content .e-content blockquote:first-child, .e-custom-class .e-source-content .e-content p:first-child, .e-custom-class .e-source-content .e-content pre:first-child, .e-custom-class .e-source-content .e-content blockquote:first-child { text-indent: 20px; } </style> |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/RTE_Server1729093470
Please check the above code snippet and the sample and let us know if it satisfies your requirement to the fullest.
Regards,
Revanth
Thanks. This still doesn't work for me. I'm not able to provide a sample program demonstrating my challenges. This is a very large app with this piece just being one small part. It's probably something elsewhere in the project that is causing the conflict.
Regardless, with my testing where this does work:
.indentPlease
{
text-indent: 40px !important;
}
I found this doesn't properly address the underlying issue.
We have thousands of existing html documents that could be well over a decade old. Some are newer. The format is not the same among them.
Therefore controlling the text-indent causes undesired formatting issues on some documents.
What I really require is a way to adjust how much the tab-key indents. Right now we have to press it about 4 times to get to the desired indent. Which, if that's what we have to do, that's what we have to do.
Thanks again for your help. I really appreciate it!
Charles
That is the default behavior, yes. However:
EnableTabKey="true"
Changes that behavior to the desired indent behavior.