英文:
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. &#10; &#13; Status for leaf nodes: health status."/>
提示文本需要换行。我尝试添加 &#10; &#13;
但没有起作用。我遇到了 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. &#10; &#13; Status for leaf nodes: health status."/>
The tooltip text need to have new line. I tried adding &#10; &#13;
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}/>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论