LaTex表格内单元格内容强制换行
2016-11-22 10:51
1971 查看
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}%放在导言区
%然后使用&\tabincell{c}{}&就可以在表格中自动换行
%比如这么用
\begin{tabular}{|c|c|}
\hline
1 & the first line //
\hline
2 & /tabincell{c}{haha// heihei//zeze} //
\hline
\end{tabular}
以下为一例子,可直接存为.tex文件编译运行:
\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{table}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
\centering
\begin{tabular}{|c|c|c|}\hline
1 & \tabincell{c}{the first line \\ the next\\the next\\ last} & \tabincell{c}{one \\ one}\\\hline
2 & \tabincell{c}{hello\\ aha\\ ok \\yes \\en}
& \tabincell{c}{two \\ two \\ two} \\\hline
\end{tabular}
\caption{longtitle}
\end{table}
\end{document}
%然后使用&\tabincell{c}{}&就可以在表格中自动换行
%比如这么用
\begin{tabular}{|c|c|}
\hline
1 & the first line //
\hline
2 & /tabincell{c}{haha// heihei//zeze} //
\hline
\end{tabular}
以下为一例子,可直接存为.tex文件编译运行:
\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{table}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
\centering
\begin{tabular}{|c|c|c|}\hline
1 & \tabincell{c}{the first line \\ the next\\the next\\ last} & \tabincell{c}{one \\ one}\\\hline
2 & \tabincell{c}{hello\\ aha\\ ok \\yes \\en}
& \tabincell{c}{two \\ two \\ two} \\\hline
\end{tabular}
\caption{longtitle}
\end{table}
\end{document}
相关文章推荐
- LaTex表格内单元格内容强制换行
- LaTex表格内单元格内容强制换行
- Latex 表格内文字过长自动换行 & 表格内单元格内容强制换行
- LaTex表格内单元格内容强制换行
- html表格内容自动换行,强制换行
- 解决html表格中内容超出不强制换行和超出宽度自动隐藏并显示省略号
- 用CSS控制表格或单元格强制换行,防止表格被英文单词或中文撑大
- css设置强制单元格内容自动/不自动换行
- 解决html表格中内容超出不强制换行和超出宽度自动隐藏并显示省略号
- [转] 如何让latex表格中一个单元格的文字换行(转)
- 解决html表格中内容超出不强制换行和超出宽度自动隐藏并显示省略号
- 强制表格内容不换行
- 火狐(firefox)强制单元格内容不换行
- 如何让latex表格中一个单元格的文字换行(转)
- 表格内容强制换行
- LaTeX中table使用小技巧:全局调整字号及单元格内容自动换行
- 用CSS控制表格或单元格强制换行,防止表格被英文单词或中文撑大
- LaTeX之表格中强制换行
- 一段遍历4X4表格,取出每个单元格内容组合成文本的JS代码
- Swift - 可编辑表格样例(可直接编辑单元格中内容、移动删除单元格)