Korsaurus
Korsaurus

Reputation: 3

Text overflow entire strings if part of the string is hidden?

Given both these emails "[email protected]" and "[email protected]". While displaying them both in a table if both emails can't be displayed fully then they are clipped in their entirety. So "[email protected], Blahblahblahblah@ex..." is supposed to be cut down to "[email protected], ..."

Upvotes: 0

Views: 80

Answers (1)

Spectric
Spectric

Reputation: 31992

You're looking for text-overflow: ellipsis:

div{
  width:300px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit
</div>

Upvotes: 1

Related Questions