TinyMCE Rich Text Editor customise table plugin

I’d like to make some changes to how the table plugin works in TinyMCE Rich Text Editor (version 2.0.9). Can I use the field tinymcerte.settings for this? If so, how should I format the below code to make it work?

	"table_default_attributes": {
		"border": 0
	},
	"table_default_styles": {
		"border-collapsed": "collapse",
		"width": "auto"
	},
	"invalid_styles": {
		"td": "width height",
		"th": "width height",
		"tr": "height"
	},
	"table_responsive_width": true,
	"table_resize_bars": false

Yes, this should work.

The content has to be valid JSON.
I guess it should work, if you wrap your code in curly brackets:

{ "table_default_attributes": { "border": 0 }, "table_default_styles": { "border-collapsed": "collapse", "width": "auto" }, "invalid_styles": { "td": "width height", "th": "width height", "tr": "height" }, "table_responsive_width": true, "table_resize_bars": false }

Ah, I’d tried with square brackets but curly did the trick. Thank you!

In a perfect world I’d also like the class “table” to be added to the table automatically. The code below adds it to the list of classes but you have to select it in the table properties panel for it to be added. From what I can tell from the TinyMCE documentation perhaps it’s not possible to have it added by default.

{ "table_default_attributes": { "border": 0 }, "table_default_styles": { "width": "100%" }, "invalid_styles": { "table": "border style width height", "td": "width height", "th": "width height", "tr": "height" }, "table_class_list": [ { "title": "Table", "value": "table" } ], "table_responsive_width": true, "table_resize_bars": false }

If it doesn’t work with TinyMCE, you could maybe write a plugin that adds the class when you save the resource.

Maybe this helps a little bit faster?