HTML标签的”name”属性的换行的HTML实体为 “ ”。

huangapple go评论64阅读模式
英文:

HTML entity for new line for name property of HTML tag

问题

我有类似的用例,如 https://stackoverflow.com/questions/23264876/html-entity-for-new-line-not-working-in-ie10/76053274

<Column columnKey="status" header="Status" body={status} style={{ width: '150px', textAlign: "center" }} headerTooltipOptions={{event:"both", hideDelay: 1000 }} headerTooltip="Status for non-leaf nodes: count of healthy, unhealthy, warning and missing leaf nodes. 
 
 Status for leaf nodes: health status."/>

提示文本需要换行。我尝试添加 
 
 但没有起作用。我遇到了 pre 标签。但我不确定它的用法。

我正在使用 primereact。列API: https://primereact.org/treetable/#api.Column

在这种情况下如何使用 pre ?

提前感谢。

英文:

I have similar usecase as mentioned in https://stackoverflow.com/questions/23264876/html-entity-for-new-line-not-working-in-ie10/76053274

<Column columnKey="status" header="Status" body={status} style={{ width: '150px', textAlign: "center" }} headerTooltipOptions={{event:"both", hideDelay: 1000 }} headerTooltip="Status for non-leaf nodes: count of healthy, unhealthy, warning and missing leaf nodes. 
 
 Status for leaf nodes: health status."/>

The tooltip text need to have new line. I tried adding 
 
 but it is not working.. I came across pre tag. But i am not sure about its usage.

I am using primereact. Column api : https://primereact.org/treetable/#api.Column

How to use pre in such scenario?

Thanks in advance.

答案1

得分: 0

添加以下 const 并将其用作参考

const tooltiptext = "非叶节点的状态:健康、不健康、警告和丢失的叶节点数量。\n叶节点的状态:健康状态。"

并将上面用作参考:

<Column columnKey="status" header="状态" body={status} style={{ width: '150px', textAlign: "center" }} headerTooltipOptions={{event:"both", hideDelay: 1000 }} headerTooltip={tooltiptext}/>
英文:

Added below const and used it as reference

const tooltiptext = "Status for non-leaf nodes: count of healthy, unhealthy, warning and missing leaf nodes.\nStatus for leaf nodes: health status."

and used above as reference:

<Column columnKey="status" header="Status" body={status} style={{ width: '150px', textAlign: "center" }} headerTooltipOptions={{event:"both", hideDelay: 1000 }} headerTooltip={tooltiptext}/>

huangapple
  • 本文由 发表于 2023年4月19日 18:28:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76053425.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定