2021年3月23日星期二

How to add space in front of string in react?

I have the following string which is rendered, but I want the top string to move a bit to the left, i.e be centred on top of the line below it. How can I add space in front of the message to do so?

enter image description here

I have tried adding an array of space but its not working:

     const {totalMinutes} = this.state       this.setState({        message: new Array(6).join('  ') + "Your order is in line\n\n" + " Please wait " + totalMinutes + " minutes for more info"       });  
https://stackoverflow.com/questions/66775069/how-to-add-space-in-front-of-string-in-react March 24, 2021 at 01:07PM

没有评论:

发表评论