gpt4 book ai didi

javascript - jsx 在一行中显示电话号码的问题

转载 作者:行者123 更新时间:2023-12-02 22:07:57 24 4
gpt4 key购买 nike

我有一个简单的问题,但我无法找到解决方案。我有这个元素

<tr className="list-group-item list-item row">
<td className="col">Phone number :</td>
<td className="col">{this.state.phone_number}{""}</td>
</tr>

我希望它能像这样显示一行

Phone number :        +1 773-381-0000                     

但是它显示了这个

                      +1 
Phone number : 773-
381-
0000

最佳答案

您可以尝试使用nowrap属性来正常显示。

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td_nowrap

<tr className="list-group-item list-item row">
<td className="col">Phone number :</td>
<td style="white-space: nowrap;" className="col">{this.state.phone_number}{""}</td>
</tr>

您的问题是表格中没有足够的空间并且文本换行。

rowcol 引导类不能很好地处理表格。在此处检查响应表 https://mdbootstrap.com/docs/jquery/tables/responsive/

关于javascript - jsx 在一行中显示电话号码的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59658344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com