TinyMCE missing table headers feature

TinyMCE missing table headers feature

by Joseph Rézeau -
Number of replies: 9
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi all,

Just noticed that Moodle's tinyMCE HTML editor is missing an important feature in its table formatting options: table headers.

See http://www.tinymce.com/develop/bugtracker_view.php?id=4962

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: TinyMCE missing table headers feature

by Itamar Tzadok -

Isn't it tinyMCE in general rather than Moodle's tinyMCE?

A quick albeit partial remedy is to include in the toolbar the 'tablecontrols' (instead of 'table') which adds the most useful table control buttons, one of which is 'cell properties'. Cell properties opens a dialogue in which you can set cell type to 'header', set 'update all cells in row' and update to get a header row. Not quite like one click header row but better than current state. smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: TinyMCE missing table headers feature

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Itamar, and thanks for your prompt reply.

1.- "Isn't it tinyMCE in general rather than Moodle's tinyMCE?" Yes!

2.- "A ... remedy is to include in the toolbar the 'tablecontrols' (instead of 'table')"

Yes, but... how does one do that? Do I have to hack the tinyMCE files? I do not see a setting for that in Moodle's admin->HTML editor page...

Joseph

In reply to Joseph Rézeau

Re: TinyMCE missing table headers feature

by Mauno Korpelainen -

Hi Joseph,

in current core moodle 2 tablecontrols are not available in toolbar (they can be added to lib/editor/tinymce/lib.php)

but you can use mouse right click - Table properties over table to change various elements of table or click the Insert table button again and

check (tick) Table caption

caption

It inserts caption tags instead of th tags but they are both valid table elements - see http://www.w3schools.com/tags/tag_caption.asp

CAPTION
AAAAAAAAA BBBBBBBB
CCCCCCCC DDDDDDD

Edit: I agree that it might be good to have an option to add th tags too - I suppose most users can copy and paste tables with th tags (made elsewhere) or edit html of table or edit the first row of table to make it look like header row (titles for columns) but with core moodle and core tinymce we just need to live with core settings smile

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: TinyMCE missing table headers feature

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Mauno "... you can use mouse right click - Table properties over table to change various elements of table..."

I had no idea you could do that! I ought to read the Wiki documentation more carefully at http://docs.moodle.org/22/en/Text_editor.blush

Thanks a lot, Mauno!

Joseph

In reply to Mauno Korpelainen

Re: TinyMCE missing table headers feature

by Itamar Tzadok -

If you work with tables in the editor (I use them extensively for question definition) the right click method is just bad.

Try to add or delete a row/column. Right click, move to row option, move to pop up menu, move back to row because you slided out of the row row and the popup menu switched to column's, try again to get to the row's popup menu ...

Alternately, in lib/editor/tinymce/lib.php, around line 143

    'theme_advanced_buttons3_add' => "table,|,code,spellchecker",

change to

    'theme_advanced_buttons3_add' => "table,tablecontrols,|,code,spellchecker",

This adds a few buttons so if you want it on a separate line you should add something like:

   'theme_advanced_buttons4' => "table,tablecontrols",

smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Re: TinyMCE missing table headers feature

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Itamar,

Should the change you suggest (adding tablecontrols) not be configurable in Site administration ► Plugins ► Text editors ► TinyMCE HTML editor?

At the moment the only setting you get there is about the Spell checker.

Joseph

In reply to Joseph Rézeau

Re: TinyMCE missing table headers feature

by Itamar Tzadok -

Absolutely, like many other things all over moodle that should be configurable in various levels.

Adding buttons to the toolbar, however, requires some consideration. If you add the buttons to an existing bar, the toolbar may be wide and since currently it can't fit itself into narrow containers it will be truncated. If you add more bars, well, you may end up with more toolbar than content box.

Another approach could be a variation on external toolbar. The editor opens with or without a toolbar and you can show/hide the toolbar by a click and the toolbar state persists per session. smile

In reply to Itamar Tzadok

Re: TinyMCE missing table headers feature

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

"Another approach could be a variation on external toolbar. The editor opens with or without a toolbar and you can show/hide the toolbar by a click and the toolbar state persists per session."

+1