如何用多行单元格编码表 [英] How to code tables with multi-line cells

查看:45
本文介绍了如何用多行单元格编码表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用LaTeX撰写一篇简短的论文,需要添加一个包含3列的表格.

I am trying to write a short paper with LaTeX and need to add a table with 3 columns.

+-------------+-----------------+--------------------------------------+
| AAAAAAAAAA  | BBBBBBBBBBBBBBB | Betty Botter Bought a Bit of Butter  |
|             |                 | but the Butter's Bitter              |
+-------------+-----------------+--------------------------------------+
| CCCCCCCC    | DDDD            | Betty Botter Thought:                |
|             |                 | If I Put This Bitter Butter in My    |
|             |                 | Batter it Will Make My Batter Bitter |
+-------------+-----------------+--------------------------------------+

不幸的是,我似乎找不到正确的习惯用法.

Unfortunately I can't seem to find the correct idiom to do it.

我尝试过:

\begin{tabular}{lll} 
    AAAAAAAAAA  & BBBBBBBBBBBBBBB & Betty Botter Bought a Bit of Butter but 
    the Butter's Bitter  \\
    CCCCCCCC  & DDDD & Betty Botter Thought: \newline If I Put This Bitter Butter in My Batter it Will Make My Batter Bitter
 \end{tabular}

但是LaTeX不会在单元格内进行任何换行或格式化.我认为我需要告诉它这样做.但是如何?

But LaTeX doesn't do any linebreaks or formatting within the cell. I assume I need to tell it to do so.. But how?

推荐答案

使用 p 列描述符:

更改

\begin{tabular}{lll} 

\begin{tabular}{llp{5cm}}

要明确插入换行符:

CCCCCCCC  & DDDD & \parbox{5cm}{Betty Botter Thought: \\ If I Put This Bitter Butter in My Batter it Will Make My Batter Bitter}

这篇关于如何用多行单元格编码表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆