This is a migrated thread and some comments may be shown as answers.

RAD Editor - paste from word - tables - extra formatting

1 Answer 180 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 08 Sep 2011, 02:58 PM
Hi
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>
            </td>



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.

Syed

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 08 Sep 2011, 07:03 PM
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:
http://www.telerik.com/help/aspnet-ajax/editor-onclientpastehtml.html

Greetings,
Dobromir
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 >>

Tags
Editor
Asked by
Syed
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or