function expressionToHtml(expression){
var reg = /[^0-9.,]+/,
temp = expression.split('|'),
result = document.createElement('table'),
trTop = document.createElement('tr'),
trBottom = document.createElement('tr'),
tdLeft = document.createElement('td'),
tdRightTop =document.createElement('td'),
tdRightBottom = document.createElement('td');
temp = temp.map(function(val){
return val.replace(reg,'');
});
result.border = 0;
tdLeft.setAttribute('rowspan', 2);
tdRightTop.style.borderBottom = '1px solid black';
result.appendChild(trTop);
result.appendChild(trBottom);
trTop.appendChild(tdLeft);
trTop.appendChild(tdRightTop);
trBottom.appendChild(tdRightBottom);
tdLeft.innerHTML = '√';
tdRightTop.textContent = temp[0];
tdRightBottom.textContent = temp[1];
document.body.appendChild(result);
tdLeft.style.fontSize = tdLeft.offsetHeight+'px';
// return result;
}
var a = '√31.36|1936';
expressionToHtml(a)