Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit TD text length

Tags:

css

backgrid

I've a grid generated by backgrid.

And I want to limit text length, each td must be on one line.

width property on td has no effect.

Thanks for your help.

enter image description here

like image 303
amiceli Avatar asked Dec 24 '22 17:12

amiceli


1 Answers

Depending on how you define 'limit', you can simply prevent wrapping, and control overflow:

td{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

This will keep contents to one line, with an ellipsis being appended to the end if textual content exceeds the allowed width of the td

like image 52
SW4 Avatar answered Dec 27 '22 05:12

SW4