I have a form that shows a table filled with email addresses, and I want to indicate to the browser that the email address can wrap before the @
; for example,
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b3824262e2724252c2e262a22272b23260b3824262e272a392c2e2f24262a225765282426">[email protected]</a>
should wrap as somelongemail<break>@somelargedomain.com
.
The typical solution is to use a zero-width space, but this may cause issues when someone tries to copy and paste the email address (they might end up pasting the email
example<zero-width-space>@example.com
, which is not a valid email).
Is there a way to create word-wrap hints without interfering with copy and paste functionality?
For instance:
table {
border: 1px solid grey;
width: 50px;
margin-bottom: 10px;
border-spacing: 0;
border-collapse: collapse;
}
td {
border: 1px solid grey;
}
<table>
<tr><td>without any break hints</td><td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e794888a828b888980828a868e8ba783888a868e89c984888a">[email protected]</a></td></tr>
</table>
<table>
<tr><td>with a zero-width space</td><td>somelongemail​@domain.com</td></tr>
</table>