Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Removing inline styling and width attribute after modifying the table in TinyMCE v2

$
0
0

I was able to remove initial inline styling and width when creating a table in TinyMCE, see https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2020/10/remove-attribute-border-in-tinymce-v2/ 

Now the problem is to remove, or not allow the editor to add attributes even when the editor tries to change the width or hight of the table by draging the tables borders. I tried using extended styles; https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@extended_valid_elements/ 

and invalid styles:

invalid_styles: { 'table': 'width height', 'tr' : 'width height','th' : 'width height','td' : 'width height'
}

But none of them fixed my problem. 

The the result I want to avoid are these inline styles and the width attribute:

<table style="height: 141px;" width="279">
<tbody>
<tr>
<td style="width: 144px;">kfjg kldfgj</td>
<td style="width: 247px;">kdfgj dklfgj</td>
<td style="width: 162px;">døfklg jdfølkgj</td>
</tr>
<tr>
<td style="width: 144px;">sdfløgk jdføkl</td>
<td style="width: 247px;">døflkg jdfklgj lkøgjdfølkgjd følgkj dfgølkdfjgølkdf gjødflkgj dfølkg jdføkgl dfjgøl</td>
<td style="width: 162px;">lkdøfg jd</td>
</tr>
<tr>
<td style="width: 144px;">løkdf gjdløfkgjdøfl kgjdfølgjkdf ølfdk gjølgkgjø</td>
<td style="width: 247px;">dølfk gjdfølkgj dfølgk jdføglkj</td>
<td style="width: 162px;">dflkøj dføgkjdfkøgldfj øglkdfjgødlkf gjdøflkgdfjø lkg</td>
</tr>
</tbody>
</table>


Viewing all articles
Browse latest Browse all 8020

Trending Articles