code: function (elm) {
          var self = this, settings = self.settings, dom = self.dom, cls;
  
          elm = elm || self.getBody();
  
          if (self.hasVisual === undefined) {
            self.hasVisual = settings.visual;
          }
  
          each(dom.select('table,a', elm), function (elm) {
            var value;
  
            switch (elm.nodeName) {
              case 'TABLE':
                cls = settings.visual_table_class || 'mce-item-table';
                value = dom.getAttrib(elm, 'border');
  
                if ((!value || value == '0') && self.hasVisual) {
                  dom.addClass(elm, cls);
                } else {
                  dom.removeClass(elm, cls);
                }
  
                return;
  
              case 'A':
                if (!dom.getAttrib(elm, 'href', false)) {
                  value = dom.getAttrib(elm, 'name') || elm.id;
                  cls = settings.visual_anchor_class || 'mce-item-anchor';
  
                  if (value && self.hasVisual) {
                    dom.addClass(elm, cls);
                  } else {
                    dom.removeClass(elm, cls);
                  }
                }
  
                return;
            }
          });
  
          self.fire('VisualAid', { element: elm, hasVisual: self.hasVisual });
        }
docs: Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
  
  @method addVisual
  @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid.