为什么Tinymce消除了我的一些内联风格?
我在电子邮件模板上使用Tinymce。这是我通过模板插件添加的模板的示例。 (请参见下文)
1-问题是Tinymce删除了第一级TD的背景色,而我不明白为什么..如果我在下一个表标签上添加背景色,则可以正常工作。由于我不想更改所有模板,允许TD上允许背景颜色和其他CSS属性的最佳方法是什么?我在TR或TD上尝试了class =“ mcetmpl”,它不会更改任何内容。
<tr>
<td>
<div class="content">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
<tr>
<td align="center" style="font-size:0;background-color: #23004C;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:100%;font-size:0;line-height:0;">
<tr>
<td align="left" valign="top" dir="rtl">
这就是我得到的。它正在删除整个tr&gt; TD&GT;桌子
<tr>
<td>
<div class="content mce-content-body" id="mce_3" contenteditable="true" spellcheck="false">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 100%; font-size: 0; line-height: 0;" data-mce-style="width: 100%; font-size: 0; line-height: 0;" class="mce-item-table">
<tbody>
<tr>
<td align="left" valign="top" dir="rtl">
I'm using tinymce on an email template. Here is an example of the template I add through the template plugin. (see below)
1-The issue is that tinymce deletes the background-color of the first level td and I don't understand why..If I add the background-color on the next table tag, it works. As I don't want to change all my templates, what is the best way to allow background color and other css properties on td ? I tried class="mceTmpl" on the tr or td, it doesn't change anything.
<tr>
<td>
<div class="content">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
<tr>
<td align="center" style="font-size:0;background-color: #23004C;">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:100%;font-size:0;line-height:0;">
<tr>
<td align="left" valign="top" dir="rtl">
And here is what I get. It's removing a entire tr > td > table
<tr>
<td>
<div class="content mce-content-body" id="mce_3" contenteditable="true" spellcheck="false">
<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 100%; font-size: 0; line-height: 0;" data-mce-style="width: 100%; font-size: 0; line-height: 0;" class="mce-item-table">
<tbody>
<tr>
<td align="left" valign="top" dir="rtl">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑和答案: finaly我发现的唯一解决方案是在文档之后修改模板的开始。我不是直接使用tr&gt; td开始使用mcetmpl类添加一个div,然后是一个表标签:
在html文件中以创建应调用模板的空间,而是删除了表标签并用一个带有选择器ID的DIV:
EDIT AND ANSWER: finaly the only solution I found was to modify the begining of my template, following the docs. Instead of starting directly with a tr>td I add a div with the mceTmpl class, and then a table tag:
and in the html file to create the space where the template should be called, I removed the table tag and replaced it by a div with the selector Id :