• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

170
Views
Cómo envolver un contenedor div alrededor de una tabla Ckeditor en pegar

Cuando pego un texto con una tabla en ckeditor 4, quiero envolver esa tabla en un div. Tengo el siguiente código que envuelve una tabla en un Div cuando inserto desde el botón en ckeditor. ¿Cómo hago lo mismo cuando pego?

Este es el código del complemento básico: primero cargue el complemento en config.js

 config.extraPlugins = 'table_wrapper';

aquí el contenido del plugin:

 CKEDITOR.plugins.add('table_wrapper', { init: function (editor) { editor.on('insertElement', function (event) { if (event.data.getName() === 'table') { var div = new CKEDITOR.dom.element('div').addClass('w3-responsive'); // Create a new div element to use as a wrapper. event.data.appendTo(div); // Append the original element to the new wrapper. event.data = div; // Replace the original element with the wrapper. } }, null, null, 1); } });
almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error