Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to use Bootstrap table styling and therefore would like that tables inserted in TinyMCE have class .table added:
<table class="table"> ... </table>
According to https://www.tiny.cloud/docs/plugins/opensource/table/#exampleusingtabledefaultattributes I have tried to do this in the Umbraco appsettings.json:
"Umbraco": { "CMS": { "RichTextEditor": { "CustomConfig": { "table_default_attributes": "{\"class\": \"table\"}" } }, ..... } },
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:
It must have been some kind of caching tricking me because now it does insert the class:
<table border="0" class="table" style="border-collapse: collapse; width: 100%;"> <tbody> <tr> <td style="width: 49.5513%;">Lorem</td> <td style="width: 49.5513%;">ipsum</td> </tr> <tr> <td style="width: 49.5513%;">Lorem</td> <td style="width: 49.5513%;">apsum</td> </tr> </tbody> </table>
The solution is to add this "RichTextEditor" node in appsettings.json :
"Umbraco": { "CMS": { "RichTextEditor": { "CustomConfig": { "table_default_attributes": "{\"class\": \"table\"}" } },
..... } },
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.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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:
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.
is working on a reply...