CSS option for Cleaning on Paste does not clean table styles

2 posts, 0 answers
  1. David Tessler
    David Tessler avatar
    23 posts
    Member since:
    Feb 2005

    Posted 12 Jul Link to this post

    What is the best way to remove the style tag from tables (table, tr, td tags)?

    I've been working with the OnClientPasteHtml event but I don't know how to reference the pasted content or the most effective way to accomplish this. Anyone have any ideas?

  2. Nikolay
    Nikolay avatar
    60 posts

    Posted 15 Jul Link to this post


    Here is how you can modify the pasted tables using OnClientPasteHtml event:
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="OnClientPasteHtml">
    <script type="text/javascript">
        function OnClientPasteHtml(editor, args) {
            if (args.get_commandName() == "Paste") {
                var html = args.get_value();
                var container = document.createElement("div");
                container.innerHTML = html;
                $telerik.$(container).find("table,tbody,thead,tfoot,tr,td,th").each(function (i, item) {

    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top