关闭表格中的自动样式 [Tinymce]

Pat*_*zyb 1 tinymce

由于没有更多的 Tinymce 论坛,如果我可以问有没有办法通过在源代码中添加 style="width: or height:" 来关闭表格功能。

谢谢

Chr*_*ler 9

我通过将以下内容添加到 tinymce 配置来解决这个问题:

invalid_styles: 'width height'
Run Code Online (Sandbox Code Playgroud)

这从所有元素中去除了宽度和高度,这适用于我的用例。我相信您也可以指定这适用于哪些元素(例如 table、tr、th、td)。

invalid_styles: { 
    'table': 'width height', 
    'tr' : 'width height',
    'th' : 'width height',
    'td' : 'width height'
}
Run Code Online (Sandbox Code Playgroud)

请参阅https://www.tinymce.com/docs/configure/content-filtering/#invalid_styles

  • invalid_styles: { 'table': 'width height', 'tr' : 'width height', 'th' : 'width height', 'td' : 'width height' } (4认同)