我有表跨度元素第。 我想跨越寬度匹配日,但實際上它填補了整個行:(寬度內的跨度
我的代碼:
for (var i = 0; i < testInfoFieldsNames.length; i++) {
title = testInfoFieldsNames[i].toLowerCase();
th = $('<th></th>');
span = $('<span></span>').addClass('cell-container').text(title);
th.append(span);
}
tableHeader.append(th);
CSS:
.cell-container {
position: absolute;
display: block;
top: 5px;
left: 0;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
我怎樣才能設置跨度,以填補 th only?
你的跨度看起來很像一個'div' –
內那是一個'div'變量'span',你確定這是正確的? –
@RoryMcCrossan你的美麗! – ScanQR