Set the initial width of the table in TinyMCE

When I add a new table with TinyMCE, the table is almost invisible because the initial width is only a few pixels.

Is there any way to change this?

+6
source share
3 answers

Open the .js table, go to line 30 with the contents

width = formObj.elements['width'].value; 

Change it to

 width = formObj.elements['width'].value != "" ? formObj.elements['width'].value : 50; 

Replace 50 with the initial width of the default table you want to set.

Hope this helps!

0
source

In TinyMCE 4.x you can do it

 tinymce.init({ plugins: "table", table_default_styles: { width: '50%' } }); 
+13
source

It has been a while, but for me just setting up a css rule that targets the tinymce table is good enough

 /* Set up inital table width and height */ TABLE.mce-item-table TR { height: 50px; } TABLE.mce-item-table TD { width: 100px; } 
-1
source

All Articles