在一行中仅显示文本,后跟 ... 在 handson table 动态列中

show text in one line only followed by ... in handson table dynamic columns

在我的手上 table 我只想在一行中显示文本,然后应该有 ...,如果有更多文本。

$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;
        };

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

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

给出你的跨度标签display:block;