Translate

Wednesday, June 18, 2014

How to Wrap/break continues text in table using CSS

We can wrap/break the continues text in table row using CSS .
Sometime user can entered long content without space between to word. like some big email ids. which can break our fixed layout web template, To avoid this designing problem, please follow following steps

Step 1

Add following code to your CSS file.
1
2
3
4
5
6
7
8
9
.ClassName{
   white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
   white-space: -pre-wrap; /* Opera 4-6 */
   white-space: -o-pre-wrap; /* Opera 7 */
   white-space: pre-wrap; /* css-3 */
   word-wrap: break-word; /* Internet Explorer 5.5+ */
   word-break: break-all;
   white-space: wrap; /* Internet Explorer 8 and other*/
   }

Step 2

Add this class to respective table cell. please refer demo.
Above css class is added to email-id column for wrap email-id content .
USER NAMEE-MAIL IDPHONE NO.CITY
User 1919822565414Chennai
User 2user2@usermail.com919874565412Bangalore

No comments:

Post a Comment