====== Table cell prettification ====== The following script pads the table cells with spaces so that all are of equal width. The bookmarkable link is [[https://jakut.is/2008/12/01/dokutidy-a-bookmarklet-for-dokuwiki-to-prettify-pad-with-spaces-the-table-cells-in-text-mode/|here]] FIXME The source code: (function() { var editor = window.document.getElementById('wiki__text'); var lines = editor.value.split('\n'); var next = function(l, n) { var a = lines[l].substr(n).indexOf('^'); var b = lines[l].substr(n).indexOf('|'); if(a === -1 && b === -1) { return -1; } var r; if(b === -1) { r = a + n; } else if(a === -1) { r = b + n; } else { r = (b < a ? b : a) + n; } if(r > 0 && lines[l].charAt(r - 1) === '|' || lines[l].charAt(r - 1) === '^') { while(lines[l].charAt(n) !== '|' && lines[l].charAt(n) !== '^') { n++; } return next(l, n+1); } else { return r; } }; var insert = function(c, l, n, p) { var s = ''; for(var i=0;i