Search code examples
tinymcedjango-tinymce

setting table attributes in TinyMCE


When ever I create a table in TinyMCE I get:

<table style="width: 200px; ...

How can I change this to:

<table width="200px" ...

I only ask becasue I'm passing the content on to pisa and it needs all tags to have attributes, not style values. I have set inline_styles and safeHTML both to false to little avail :(


Solution

  • Assuming you editor is your tinymce editor object try

    $(editor.getBody()).find('table').attr('width', '200px');