Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
Default Margin setting
posted

I am having an issue when I paste HTML to the RichTextEditor. I have overriden my Derfault Paragraph Settings but I still get weird margins on empty <p> tags. I have a table I am pasting from a web page that has some empty columns <td></td> and when that happens it automatically inserts a <p>&nbsp;</p> and it assigns it a margin of 6px? I do not know why. Here are my paragraph settings:

var settings = new Infragistics.Documents.RichText.ParagraphSettings();
settings.Spacing = new Infragistics.Documents.RichText.ParagraphSpacingSettings();
settings.Spacing.LineSpacing = new Infragistics.Documents.RichText.LineSpacing(new Extent(0, ExtentUnitType.LogicalPixels), ExtentRule.Exact);
settings.Spacing.AfterParagraph = new Infragistics.Documents.RichText.ParagraphVerticalSpacing(new Extent(0, ExtentUnitType.LogicalPixels));
settings.Spacing.BeforeParagraph = new Infragistics.Documents.RichText.ParagraphVerticalSpacing(new Extent(0, ExtentUnitType.LogicalPixels));
settings.WordWrap = true;
return settings;

Any advice is appreciated

Parents
No Data
Reply
  • 34510
    Offline posted

    Hi Carson,

    Are you directly pasting the HTML text into the rich text editor?  Currently if I copy the following HTML it displays it the same way in the rich text editor:

    <table style="width:100%">
       <tr>
        <td></td>
         <td></td>
        <td>50</td>
       </tr>
      <tr>
        <td>Eve</td>
         <td>Jackson</td>
        <td>94</td>
       </tr>
    </table>

    I don't see any weird margins or the <p>&nbsp;</p> text getting automatically inserted.  Maybe I'm not understanding what the exact issue is?  I attached the sample I used for testing this.  There isn't much to it.  I just have the RichTextEditor in the window and I apply the ParagraphSettings you created to the RootNode.Settings.DefaultParagraphSettings.

    RichTextEditorPasteHtml.zip
Children