We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2901
    • 277 Posts
    Hi folks

    once in a while one has no choice but using tables. TinyMCE keeps adding border="0" to the table tag which is invalid.

    Is there a way to prevent tinyMCE from adding the border to the table element?

    modx 1.0.4
    tinyMCE 3.3..5.1

    Thanks a lot in advance
      • 32337
      • 28 Posts
      I came here to ask the same question, weird.
        • 2901
        • 277 Posts
        Hi all

        sorry when I ask again on this one, but have no solution yet.

        Is there a way to stop TinyMCE adding border elements to tables?

        Tanks a lot!
          • 32337
          • 28 Posts
          This is a bit late, and not a good solution, but what I ended up doing was adding <table border="0"> to a plugin that replaces various annoyances.

          $e = &$modx->Event;
          switch ($e->name) {
          
          case 'OnParseDocument':
          
                  $replace = array(
                                   '<p>[!'    => '[!',
                                   '!]</p>'   => '!]',
                                   '<p>[['    => '[[',
                                   ']]</p>'   => ']]',
                                   '<p>{{'    => '{{',
                                   '}}</p>'   => '}}',
                                   '<table border="0">' => '<table>'
                                   );
                  $this->documentOutput = str_replace(array_keys($replace), array_values($replace), $this->documentOutput);
          
          break;
          
          default: '';
          
            return;
          }
          
            • 4301
            • 1 Posts
            Hello

            I found a solution for that border problem.


            • Go the folder "assets/plugins/tinymce/js"
            • open xconfig.js
            • around line 11 you should find the following
            + "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"


              replace it with
            + "-blockquote,-table[border|cellspacing|cellpadding|width|frame|rules|"


            That fixed the problem for me.

            Hope it helps

            Michael
              • 36926
              • 701 Posts
              Hey does anyone have a revo solution for this as it looks like an Evo one, and ideally something that not going to get overwritten when TinyMCE is upgraded.