【问题标题】:show text in one line only followed by ... in handson table dynamic columns在handson表动态列中仅在一行中显示文本,后跟...
【发布时间】:2017-12-07 17:37:50
【问题描述】:

在我的 handSon 表中,我只想在一行中显示文本,之后应该有 ...,如果有更多的文本。

$scope.textRenderer = function (instance, td, row, col, prop, value, cellProperties) {
            if (cellProperties) {
               
                var template;
                template = ['<span style="white-space:nowrap; overflow:hidden;text-overflow: ellipsis;">' + value + '</span>'].join('');
                while (td.firstChild) {
                    td.removeChild(td.firstChild);
                }

                if (!td.firstChild) {
                    td.appendChild($compile(template)($scope)[0]);
                }
            }
            return td;
        };

我试过上面的代码,但省略号没有显示。

【问题讨论】:

    标签: javascript css dynamic handsontable


    【解决方案1】:

    您尝试执行的操作不适用于 inline 元素。

    给你的 span 标签display:block;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-28
      • 2021-12-30
      • 2011-03-21
      • 2022-01-23
      • 1970-01-01
      • 2014-12-27
      • 1970-01-01
      相关资源
      最近更新 更多