Great answer and does solve the original issue but unfortunately it does not remove the border="1" attribute that is added by default. Have you managed to achieve that?
The following applies the default class and removes the border value but not the attribute unfortunately:
Rich text editor: How to add class ".table" to inserted tables?
I want to use Bootstrap table styling and therefore would like that tables inserted in TinyMCE have class .table added:
According to https://www.tiny.cloud/docs/plugins/opensource/table/#exampleusingtabledefaultattributes I have tried to do this in the Umbraco appsettings.json:
But it has no effect, so I guess I am not doing it right.
Which version bootstrap?
Did you include bootstrap styling/scripting to your page? You will need this to take effect.
https://getbootstrap.com/docs/5.0/content/tables/
Yes, Bootstrap is included in my frontend setup. The problem is that in the rich text source view I can see no class added:![enter image description here](/media/upload/95348e77-f29f-4ed5-96d9-2d93ecfeb272/sdasd.png)
It must have been some kind of caching tricking me because now it does insert the class:
The solution is to add this "RichTextEditor" node in appsettings.json :
..... } },
How did you get around whatever caching is in place? I've added the same thing but it's not updating after an app restart.
I have no good advice since the above worked for me, sorry.
Great answer and does solve the original issue but unfortunately it does not remove the
border="1"
attribute that is added by default. Have you managed to achieve that?The following applies the default class and removes the border value but not the attribute unfortunately:
"table_default_attributes": "{ \"class\": \"table\", \"border\": \"\" }"
The TinyMCE docs indicate the athis should remove all attributes but it doesn't:
table_default_attributes: {}
is working on a reply...