java - How to handle line breaks when copy/pasting from HTML to MS Excel -


my java program creates html file main part consists of table. 1 of table columns contains text values happen have line breaks (<br/> in html table).

the output html needs copy/pasted ms excel file later on user. went smoothly until needed transform line breaks excel ones.

whenever there's occurence, first line of said column put fitting excel column, second line creates new line starting @ column 1.

enter image description here

enter image description here

this questions has been asked several times no answer has been given when there no asp involved. needless say, <br style="mso-data-placement:same-cell;"> not work.

thanks answer, i'm desperate fixed.

so personal experience excel , html battled 1 well. excel likes break put in formatted excel.

my best answer create "excel" formatted version of html people want copy , paste it. (you link/button switch formatting simple html excel html)

by excel html, mean format use char(13) / char(10) instead of < br \>.

i on mac char(13) works me. see attached jsfiddle solution.

the 1 caveat has have enable word wrap on field.

http://jsfiddle.net/o0nmcnex/

<table style="width:100%">   <tr>     <td>jill</td>     <td>smith</td>        <td>=50 & char(13) & 50</td>   </tr>   <tr>     <td>eve</td>     <td>jackson</td>      <td>94</td>   </tr> </table> 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -