1

It was facing problems while trying to work with the Google Chart table. Because the newline character is not applied.

or \n or \r\n or \n also did not apply. Google Chart table in any way as I would like to know whether you can use a newline character.

유리나
  • 29
  • 1
  • maybe try something like this with
    - http://stackoverflow.com/questions/10034323/newline-in-google-spreadsheet-not-outputting-in-google-chart-table
    – Mike B Apr 13 '16 at 07:29

2 Answers2

1

use allowHtml option to enable HTML into cells values, this way you can use <br/>.

 table.draw(data, {showRowNumber: true, allowHtml:true, width: '100%', height: '100%'});

see this fiddle: https://jsfiddle.net/grassog/20a6a8no/2/

Giuseppe
  • 846
  • 5
  • 10
0

Add below lines to the drawTable() function. Check this fiddle's first cell, i have added a new line.

var inHTML = document.getElementById('table_div').innerHTML.replace(/\n/g, '<br />');
document.getElementById('table_div').innerHTML = inHTML;

Check this fiddle

Pugazh
  • 9,453
  • 5
  • 33
  • 54