问题描述
我在制表符中有一个填充文本的列.文本以换行符显示.
{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; }
这篇关于链接换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!