F
Filament8mo ago
Lars

Text overflow ellipsis

Hi all, I'am looking for a way to the size the textcolumn according to the screen size. If the size get below a certain the overflow needs to be shown with css ellipsis. I have tried it using extraAttributes but that doesn’t work since that styling gets applied to the outside div instead of the span Is their a way to do this? Thanks!
No description
7 Replies
dissto
dissto8mo ago
->extraCellAttributes([
'class' => 'xxx',
])
->extraCellAttributes([
'class' => 'xxx',
])
?
Lars
LarsOP8mo ago
This adds the styling to the TD element instead of the span the element where de text is in. With limit the text is always limited to the same amount of characters in my case in should work based on the available space
dissto
dissto8mo ago
Well I suppose you could ->formatStateUsing() then and return the span however you like?! But even if its on the td itself it should cascade?
Lars
LarsOP8mo ago
Could i return html in formatStateUsing();
dissto
dissto8mo ago
Sure
->formatStateUsing(function($state){
return new HtmlString('<span class="yay">'. $state .'</span>');
})
->formatStateUsing(function($state){
return new HtmlString('<span class="yay">'. $state .'</span>');
})
(from memory -> untested) 🤣
Lars
LarsOP8mo ago
Ah oke, I will try that then thanks!
Want results from more Discord servers?
Add your server