链接换行 [英] Linebreaking of links

查看:36
本文介绍了链接换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

当我介绍

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

解决方案

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

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

选项:

  1. 编写一个自定义格式化程序(以呈现带有white-空格:预包装")
  2. 添加您自己的 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:

  1. Write a custom formatter (to render a link with "white-space: pre-wrap")
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆