Wednesday, March 5, 2008

How to break lengthy lines

Tutorial:http://www.css3.com/css-word-break/

<td width="60%" style="word-break: break-all;"><bean:write name="ABCForm" property="description" /></td>

Description: "word-break: break-all" is a CSS style property which helps in bringing lengthy lines which doesn't have breaks(spaces) to next line. We can define it in an independant CSS file(wrap.css) as well and include it in our jsp pages.

This how we include the independant CSS file into our JSP Page.
<link rel="stylesheet" type="text/css" href="../css/wrap.css">

In the below independant css, we are specifying the style property for all the TD's. This means all the TD's which have a width property specified will obey this CSS Style.

wrap.css
--------
@CHARSET "ISO-8859-1";
TD {
word-break: break-all;
}

No comments: