According to the MDN tab-size , the correct format is:
tab-size: 4; -moz-tab-size: 4; -o-tab-size: 4;
JavaScript error:
var fix_tab_size = function(pre, size) { if(typeof fix_tab_size.supports === 'undefined') { var bs = document.body.style; fix_tab_size.supports = ('tab-size' in bs || '-o-tab-size' in bs || '-ms-tab-size' in bs || '-moz-tab-size' in bs); } if(!fix_tab_size.supports) { if(typeof pre.each === 'function') { //jquery $('pre').each(function() { var t = $(this); t.html(t.html().replace(/\t/g, new Array(size+1).join(' '))); }); } else if(typeof pre.innerHTML === 'string') { pre.innerHTML = pre.innerHTML.replace(/\t/g, new Array(size+1).join(' ')); } } } $(function() { fix_tab_size($('pre'),4); //or $.getJSON(src, function(data) { fix_tab_size($data_pre.html(data.code)); //etc }); });
source share