latex 表格中单元格换行,显示多行

除了使用multirow的方式(比较麻烦),更好地办法是用下面的语句,能够使得一个单元格中显示多行,再配合其它格式语句,就能使得表格很是美观。ide

\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}spa

下面一个比较综合的例子:
blog

\begin{table*}[htbp]ci

\centeringget

\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}it

\caption{XXXXXXX}io

\begin{tabular}{|m{0.5cm}<{\centering}|m{2.5cm}<{\centering}|m{1.5cm}<{\centering}|m{1.5cm}<{\centering}|m{1.5cm}<{\centering}|m{1.5cm}<{\centering}|m{1.5cm}<{\centering}|}table

\hlineclass

\multicolumn{2}{|m{3cm}<{\centering}|}{Test instance}&command

Number of the decision variables &

The decision space &

Number of the linear equations &

Number of the nonlinear equations &

Number of the optimal solutions\\

\hline

F1 &

\tabincell{l}{equ1 \\ equ2} &

2 &

2 &

2 &

2 &

2 \\

\hline

F1 & & & & & & \\

\hline

F2 & & & & & & \\

\hline

F3 & & & & & & \\

\hline

F4 & & & & & & \\

\hline

F5 & & & & & & \\

\hline

F6 & & & & & & \\

\hline

F7 & & & & & & \\

\hline

\end{tabular}

\end{table*}

最终效果如图:

wKioL1S4f1_Q1IqMAAFP5K700FA858.jpg

相关文章
相关标签/搜索