在用Texstudio编写表格,遇到表格无法换行的问题,查了一大堆方法都不好用,最后参考icode9上的一篇博文才找到最简便的方法,分享给大家。

错误情况

可以看到,第二列内容太长,导致第三列的内容都被挤没了

以下是我的代码,我曾经尝试\begin{tabularx}{\textwidth}{lXXX} 以及/tabincell{c}{haha// heihei//zeze} 的方法都改不动,相信大家应该遇到类似问题。

     \begin{tabular}{ccc}\toprule Biodiversity quality grade & Feature description \centering                                                                                         & Adjustment coefficient \\ \hlineHigh                       & The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent & 2                      \\High            & The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent             & 1                      \\High                    & The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent                      & 0                      \\High            & The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent                        &  1                      \\High                        & The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent The ecosystem is in excellent             & 2                      \\ \bottomrule\label{t2}      \end{tabular}

调整情况


以上是我的最终效果,可以看到表格都显示出来了,而我只是对\begin{tabular}{ccc}\toprule 进行了调整:

\begin{tabular}{cp{8cm}c}\topruleBiodiversity quality grade & Feature description \centering

其中,原本{ccc}对应3列,我对其中一个c(这里是第二列)固定了长度,改写为p{8cm},这样写以后,表内内容会自动换行。同时,使用p会导致对应列内容左对齐,如果需要居中,在文本后加入\centering就可实现。

如果帮助到大家,希望能给我点个赞~

Latex表格内容过长,最简单自动换行方法相关推荐

  1. latex表格内容上下居中_LaTeX表格紧跟文字 (不影响下方文本对齐)

    Latex 表格内文字过长自动换行 法一: [plain] view plaincopy \begin{tabular}{m{5cm}} 法二: [plain] view plaincopy \beg ...

  2. antdesign中表格内容太长或者select内容太长如何悬浮显示?

    需求:antdesign中表格内容太长或者select内容太长如何悬浮显示? 考虑:我们在学HTML的时候,有一个标签属性是 title,它有什么作用呢? title 属性规定关于元素的额外信息.这些 ...

  3. Latex 表格过大(或过小)的调整方法

    参考    Latex 表格过大(或过小)的调整方法 - 云+社区 - 腾讯云 1 表格宽过窄 问题: 表格宽度小, 与页面大小不匹配, 效果前后如下图所示. 目标: 调整表格宽度, 效果为" ...

  4. latex表格内容上下居中_latex怎么让表格里的字上下垂直居中?

    试了一下,LaTeX表格中的单元格在单行的情况下在竖直方向上应该是垂直居中的,所以我猜测您的问题应该是在限定了列宽之后由于自动换行导致的其他列无法做到在竖直上居中,解决方法是使用multicolumn ...

  5. layui 数据表格内容过长遮挡_word表格技巧:遇到这三种情况,你会处理么?

    编按:工作中,除了文字排版,表格应该是排版中比较麻烦的一类.因为各种文档的格式不同,表格也需要随机应变.因此,在排版的过程中,难免会遇到一些表格问题,今天小编总结了3个表格排版常见问题,快来看看吧,希 ...

  6. td标签中,内容过长不会自动换行

    当 td 输入内容长度时,即使设置了 td 的宽度也是无效的.主要是内容没有自行换行,而是一直撑大原来设置的 td 宽度. 这是我们需要设置给  td 标签设置样式:word-wrap:break-w ...

  7. java poi word 复制_Java 使用POI填充Word表格内容和复制模板行属性方法示例代码

    1、填充Word表格内容/** * 循环填充表格内容 * @param xwpfDocument * @param params * @param tableIndex * @throws Excep ...

  8. Latex 表格内容自动换行居中

    1.在导言区添加宏包:\usepackage{makecell} 2.环境:tabular 命令:\makecell[居中情况]{第1行内容 \\ 第2行内容 \\ 第3行内容 ...} 参数说明: ...

  9. latex表格内容上下居中_LaTex表格内单元格内容换行

    如何同时让表格同一行一个单元格的文字能垂直居中?比如说文字超长超出页面范围需要分行显示. ~~~ newcommand{tabincell}[2]{begin{tabular}{@{}#1@{}}#2 ...

最新文章

  1. selenium启动Firefox示例
  2. 数据分析的 8 种思维
  3. sqlmap 进行sql漏洞注入
  4. java程序员遇到的问题_JAVA程序员最常遇见的10个异常
  5. 【C++11新特性】 C++11智能指针之shared_ptr
  6. 当你抛弃windows使用linux,当我们厌倦了Windows系统还能考虑什么样的桌面操作系统?...
  7. mysql写下拉树_PHP+mysql实现从数据库获取下拉树功能的方法
  8. idea切换视图快捷键_IDEA操作技巧:一些常用且实用的快捷键
  9. error C2143: 语法错误 : 缺少“;”(在“using”的前面)
  10. C#制作、打包、签名、发布Activex全过程【转】
  11. 毕业设计!Python实现学生教师刷脸签到系统
  12. 外部IC寄存器的位定义
  13. 为什么说Redis单线程效率高
  14. 前端骨架屏方案与实践
  15. html计时加速,HTML-加速、再加速
  16. 用tushare数据自定义期货大宗商品指数(3)
  17. 使用sftp在客户端与服务器之间进行文件传输
  18. 屌丝程序员的2012
  19. 《怪诞小镇》的怪诞之物
  20. kafka启动异常InconsistentClusterIdException

热门文章

  1. 【用ArcGIS制作一张好看的中国月度气温图
  2. 一文看懂推荐系统:概要02:推荐系统的链路,从召回粗排,到精排,到重排,最终推荐展示给用户
  3. Windows无法安装到GPT分区形式磁盘 - 解决方案
  4. 解决windows 7的网关mac绑定以及与 P2Pover的冲突
  5. 用C语言模拟双色球开奖
  6. java对三次函数求导_如何画三次函数图像
  7. ChatGPT帮你写简历找工作
  8. 从内存中加载DLL DELPHI版
  9. 机器视觉lots光源
  10. Don't know how to handle message of type 'java.lang.String'. Are you missing a protocol encoder?