2 * @class Roo.htmleditor.FilterTableWidth
3 try and remove table width data - as that frequently messes up other stuff.
5 * was cleanTableWidths.
7 * Quite often pasting from word etc.. results in tables with column and widths.
8 * This does not work well on fluid HTML layouts - like emails. - so this code should hunt an destroy them..
11 * Run a new Table Filter
12 * @param {Object} config Configuration options
15 Roo.htmleditor.FilterTableWidth = function(cfg)
17 // no need to apply config.
18 this.tag = ['TABLE', 'TD', 'TR', 'TH', 'THEAD', 'TBODY' ];
22 Roo.extend(Roo.htmleditor.FilterTableWidth, Roo.htmleditor.Filter,
27 replaceTag: function(node) {
31 if (node.hasAttribute('width')) {
32 node.removeAttribute('width');
36 if (node.hasAttribute("style")) {
39 var styles = node.getAttribute("style").split(";");
41 Roo.each(styles, function(s) {
45 var kv = s.split(":");
46 if (kv[0].match(/^\s*(width|min-width)\s*$/)) {
49 // what ever is left... we allow.
52 node.setAttribute("style", nstyle.length ? nstyle.join(';') : '');
54 node.removeAttribute('style');
58 return true; // continue doing children..