1

In web apps, there are often places where I display email addresses in a table column, and every time there is a long email address, it stretches the column and messes up the table width or column balance.

The current solution to this problem that I am using is to insert the <wbr/> tag to encourage the email to break cleanly at the midpoint when it is too wide. So a chunk of html like

user<wbr/>@domain.com

will render as

user@domain.com

when there is space and

user
@domain.com

when there is not.

This is the display behaviour I want, but it is an unsatisfactory solution, because when I select and copy an email from the page, the embedded break is captured too, as an invisible control character, and corrupts the email address for pasting into other fields.

It seems there should be some directive in CSS that allows extra characters to be identified as preferable for word breaking on, in addition to the standard space and hyphen break characters.

This would create the same wrapping behaviour without needing to change the actual content by inserting the tag.

But I can't seem to find anything like this. What possible solutions are there?

stephen
  • 303
  • 1
  • 8
  • Can you recreate the issue? to look into. – Manjuboyz May 15 '20 at 04:08
  • Duplication [Wrapping long email addresses in small boxes](https://stackoverflow.com/questions/23776767/wrapping-long-email-addresses-in-small-boxes) – chojnicki May 15 '20 at 04:29
  • Try putting a max-width on the column then play around with white-space or word-break, if necessary. – wazz May 15 '20 at 04:29
  • @chojnicki, no it's not a duplicate. The answer to the question you identify is suggesting inserting exactly the characters that I point out as causing the whitespace problem on copy. This issue is still unresolved. – stephen May 22 '20 at 23:06

1 Answers1

0

Try to truncate email text in some width. Then add tooltip below email. So you can copy addresses and not break width of the column

Sabit Rakhim
  • 460
  • 3
  • 12