自动换行的设置:

HSSFCellStyle cellStyle=workbook.createCellStyle();
cellStyle.setWrapText(true);
cell.setCellStyle(cellStyle);

强制换行:

<pre name="code" class="html">HSSFCell cell = row.createCell((short)0);
cell.setCellStyle(cellStyle);
cell.setCellValue(new HSSFRichTextString("hello/r/n world!"));

修改代码如码如下

HSSFCell cell = row.createCell((short)0);
cellStyle.setWrapText(true);//先设置为自动换行
cell.setCellStyle(cellStyle);
cell.setCellValue(new HSSFRichTextString("hello/r/n world!"));

最新文章

  1. Android中BroadcastReceiver的两种注册方式(静态和动态)详解
  2. 初次认识 C# win32 api
  3. Swift_String的操作
  4. 警告 - no rule to process file &#39;WRP_CollectionView/README.md&#39; of type net.daringfireball.markdown for architecture i386
  5. PostgreSQL: 一种用于生成随机字符串的方法
  6. API 版本控制
  7. MySQL全世界最流行的开源数据库软件
  8. win8 Pro 64位在 UEFI模式下Ghost系统 备份 恢复
  9. .NET c# 串口通信
  10. Duanxx的Altium Designer学习:PCB试想一下,在目前的水平
  11. service structure flowchart with full stack functionality in a brife map
  12. perl的列表(List)和数组(Array)
  13. springMVC源码分析--国际化LocaleResolver(一)
  14. springboot全局捕获异常
  15. Visualizing the Git data model
  16. centos安装RabbitMQ 3.7.9 (使用RPM)
  17. CentOS 7 休眠系统
  18. Java备份文件
  19. 关于div文字点击编辑的插件
  20. JavaScript 第二章总结

热门文章

  1. RVO和NRVO
  2. SQL 2008提供几种数据同步方式
  3. 关于python+django操作数据库中的表
  4. C语言学习笔记--函数与指针
  5. 【276】◀▶ Python 字符串函数说明
  6. LinkedHashMap和HashMap的区别
  7. springmvc 中异常处理
  8. 【总结整理】WebGIS学习-thinkGIS(三):关于影像金字塔、瓦片行列号、分辨率resolution
  9. 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-002插入排序法(Insertion sort)
  10. Java-数据结构与算法-选择排序与冒泡排序