RAD Editor - paste from word - tables - extra formatting

2 posts, 0 answers
  1. Syed
    Syed avatar
    4 posts
    Member since:
    Nov 2010

    Posted 08 Sep 2011 Link to this post

    I am trying to paste a document from word into the RAD Editor.
     I have tried all the options available to me , i.e. paste from word, paste from word - strip font etc etc.

    The issue is that the tables come up with really wierd extra style attributes which makes the rendering of the table in html totally messed up.

    For example, below is a snippet of the HTML generated of one cell.
    <td valign="bottom" style="border:1pt solid windowtext;width: 77.25pt;             padding-top: 0in; padding-right: 5.4pt; padding-bottom: 0in; padding-left: 5.4pt;">
                <p style="margin-top: 2pt; margin-right: 0in; margin-bottom: 2pt; margin-left: 0in; text-align: center;"><strong>Area</strong></p>

    Notice the stuff in the style attribute for the <td>

    So my question is:
    a) Can this be fixed at the time of pasting?
    b) If not, can there be some call back mechanism that I can use to strip the style tags manually?

    Let me know if you want me to attach the original file as well.

  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 08 Sep 2011 Link to this post

    Hi Syed,

    You can handle the RadEditor's ClientPasteHtml event to examine and snip the unwanted style attributes that will be pasted in the content. Please review the following help article for more detailed information regarding ClientPasteHtml event:

    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top