Add a “new line” in innerHTML

前端 未结 3 1995
猫巷女王i
猫巷女王i 2020-12-13 19:07

I am trying to create a table with images in first cell and information about the pic in second cell.

I need to add different information in one cell, like that:

3条回答
  •  执笔经年
    2020-12-13 19:19

    No,
    does not work in asp .net but you can instead write it like so

    cellTwo.innerHTML = arr_title[element] + arr_tags[element]; arr_title[element] + "/n" + arr_tags[element];
    

    Edit - alternative wrapped in code tags

    cellTwo.innerHTML = arr_title[element] + arr_tags[element];
    cellTwo.innerHTML += arr_title[element] + "/n" + arr_tags[element];
    

    Semicolon ";" seems to act as line breaks Remember the "+=" to assign multiple values to the string

提交回复
热议问题