链接换行

编程入门 行业动态 更新时间:2024-10-25 12:19:45
本文介绍了链接换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在制表符中有一个填充文本的列.文本以换行符显示.

{title:"Title", field:"title", formatter:"textarea"},

当我介绍

有没有办法在保留换行符的同时引入链接?

解决方案

默认情况下,tabulator 使用white-space: nowrap"来呈现单元格(定义在 tabulator-cell 中的 CSS class tabulator-cellem>tabulator.css).

格式化程序textarea"通过在单元格元素的样式上手动设置pre-wrap"来覆盖它:modules/format.js

选项:

编写一个自定义格式化程序(以呈现带有white-空格:预包装")添加您自己的 CSS(after tabulator.css,以确保 css 级联工作)以将 tabulator-cell 内的链接定位到设置空白:预包装".这应该有效:

.tabulator-row .tabulator-cell a {空白:预包装;}

I have a column filled with text in tabulator. The text is displayed with line breaks.

{title:"Title", field:"title", formatter:"textarea"},

When I introduce the built in URL formatter, the text in the first column does not break anymore.

  {title:"Title", field:"title", formatter:"textarea", formatter:"link", formatterParams:{target:"_blank", urlField:"source"}},

Is there a way to introduce link while keeping the linebreaks?

解决方案

By default, tabulator renders the cells with "white-space: nowrap" (as defined in CSS class tabulator-cell in tabulator.css).

The formatter "textarea" overrides that by manually setting "pre-wrap" on the style of the cell element: modules/format.js

Options:

Write a custom formatter (to render a link with "white-space: pre-wrap") Add your own CSS (after tabulator.css, to make sure the css cascade works) to target links inside tabulator-cell to set "white-space: pre-wrap". This should work:

.tabulator-row .tabulator-cell a {
    white-space: pre-wrap;
}

这篇关于链接换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 10:43:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408807.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:换行   链接

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!