lundi 16 décembre 2019

Displaying Javascript variable into multiline in a div

I am getting dynamic variable from webservice. I want to add the empty space or breaktag tag in the javascript variable.

For eg:

let myVal = "myname 123456789 NZD".

when displaying in the UI I want to display the names like below in a single div

myname 
123456789
NZD

The variable name all are dynamic. I am using word-wrap: break-word.

But few text cut of eg:

firstname last
name 123456789.

How to achieve like below :

myname 
123456789 
NZD

I am using below css:

div{
    position: relative;
    top: 5px;
    left: 10px;
    width: 46%;
    min-height: 22px;
    height: auto;
    font-family: "Montserrat-SemiBold";
    font-size: 15px;
    font-weight: 600;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.47;
    letter-spacing: normal;
    color: #000000;
    padding-bottom: 11px;
    word-wrap: break-word;
}



Aucun commentaire:

Enregistrer un commentaire