Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:34:47+00:00 2026-06-08T00:34:47+00:00

Our application uses ckeditor to generate user friendly email content to send email to

  • 0

Our application uses ckeditor to generate user friendly email content to send email to clients. Email content is prepared by business people so they don’t know any html at all.

So I want ckeditor to add inline style to paragraphs(<p> elements) such as <p style="line-height:20px;"> automatically instead of just generating <p>.

Since the generated output is emailed I don’t have any chance to use CSS file.
I tried to wrap <p> elements within <table> but I couldn’t change “line-height” property in that way, since email sites like gmail, yahoo have already their own styling for <p> elements. I must use inline style for each <p> element I think and I don’t know how to achieve this.

Can anybody help?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:34:48+00:00Added an answer on June 8, 2026 at 12:34 am

    There isn’t a setting or quick code modification to do this.

    Here are Two approaches.

    If you would like to annoy your users do this (see AlfonsoML’s comment):
    If you would like the flexibility to do more than the <p> styling as the content is updated in the editor, the best approach would likely be to use the “onchange” plugin created by @AlfonsoML. You can download it here:
    onChange event for CKEditor

    He demonstrates how to use it to show the editor content in another <div> here:
    pass Ckeditor value to div text without html tags?


    After installing the plugin, you could do something like this:

    CKEDITOR.on('instanceCreated', function (e) {
        e.editor.on('change', function () {
            var editorContent = CKEDITOR.instances['TextAreaID'].getData();
            editorContent.replace('<p>', '<p style="line-height:20px;">');
            CKEDITOR.instances['TextAreaID'].setData(editorContent);
        });
    });
    

    Better Approach:
    If you only want to do the <p> styling and prefer to avoid the overhead of running that function every time the content changes, you could load a stylesheet to apply the style to the <p> elements within the editor with this config setting:

    config.contentsCss = '/css/mysitestyles.css';
    

    Then use an onsubmit function with your form. Something like this:

    <form name="ff" id="ff" action="xx" method="POST" onsubmit="return doSubmit();">
    

    The function:

    function doSubmit() {
        var emailContent = $('textarea#TextAreaID').val();        
        emailContent.replace('<p>', '<p style="line-height:20px;">');
        $('textarea#TextAreaID').val(editorContent);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application uses Simple MAPI to send e-mails. One of our clients has problems
Currently, our application uses a javax.mail to send email, using javax.mail.MailMessage. We set the
Our application uses SQL Server Reporting Services and allows users to add custom filters
Our application uses Hibernate with Sql Server 2005. Being a DBA, I am not
Our application uses a SQL Server back-end with many stored procedures. Recently, while trying
Our application is a Java-GWT application that uses Guice-Persist and Guice-Servlet extensively. We have
We just came across a weird bug in our application that uses the asp.net
I'm trying to set up a test environment for our application that uses X.509
After a couple of months of using our application (which internally uses Jackrabbit 1.6.4
I am working on a caching strategy for our application, which uses both Redis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.