PDA

View Full Version : Is there any way to decide cell width of excel.



priya
26 Jul 2006, 02:08 AM
I am showing an excel sheet which user can open/save in browser. I am doing it plainly by setting content type to excel in the JSP file. <%@page contentType="application/vnd.ms-excel" %>

The problem is data in some cells does not fit in defalut size. When long texts are entered I need to get it Word-wrapped, instead it widens the cell.

<td colspan="8" rowspan="4" class="veblack1" valign="top" style="width:10;wrap:auto;text-wrap:hard-wrap;word-wrap:break-word;overflow:hidden;">=TEXT("<%=lComments%>"," ")</td>

Thanks in advance..
priya

Rincewind
30 Jul 2006, 01:53 AM
So now I have to spend several hundred dollars on a MS Office licience just to see your site. Not that I'd want to anyway as excel files are not suitable for use on the web (too easy to spread viruses using them.) You'd be better converting you excell file into a more portable format such as html or pdf.

As for the problem, I'd suspect the word wrap is controled by this code

wrap:auto;text-wrap:hard-wrap;word-wrap:break-word;

Try removing or changing the settings on some of those wrap styles.