【笔记】latex做表格

这里写自定义目录标题

      • 表格换行,用这个搞定

	\begin{table}[width=.9\linewidth,cols=4,pos=h]
		\caption{This is a test caption. This is a test caption. This is a test
			caption. This is a test caption.}\label{tbl1}
		\begin{tabular*}{\tblwidth}{@{}LLLL@{} }
			\toprule
			Methods & Images & Type & Targets\\
			\midrule
			\multirow{3}{*}{Rectangular box} & \multirow{3}{*}{1655} & Rust & 6387 \\
			& & Others & 2003 \\
			& & Mid-late & 677 \\
			\bottomrule
		\end{tabular*}
	\end{table}

【笔记】latex做表格_第1张图片
前面一定要加

			& & Others & 2003 \\
			& & Mid-late & 677 \\

不可以这样,会到前面去

			Others & 2003 \\
			Mid-late & 677 \\

在这里插入图片描述

表格换行,用这个搞定

【笔记】latex做表格_第2张图片

\begin{table}[width=.9\linewidth,cols=6,pos=h]
	\caption{Attributes of the four datasets}\label{tbl1}
	\begin{tabular*}{\tblwidth}{@{}LLLLLL@{} }
		\toprule
		\makecell{Dataset\\Comb.} & \makecell{Train\\set}  & Valset & \makecell{Dataset\\Comb.} & \makecell{Train\\set} & \makecell{Val\\set} \\
		\midrule
		1 & \multicolumn{2}{c}{W} & 5 & W & \multirow{3}{*}{R+C} \\
		2 & \multicolumn{2}{c}{W+S} & 6 & W+S \\
		3 & \multicolumn{2}{c}{R+C} & 7 & W+S+R+C \\
		
		4 & \multicolumn{2}{c}{W+S+R+C}\\
		\bottomrule
	\end{tabular*}
\end{table}

用\cline,下一行与line的间距会显得很挤
【笔记】latex做表格_第3张图片

用\cmidrule就好很多
在这里插入图片描述

【笔记】latex做表格_第4张图片

你可能感兴趣的:(笔记,其他,经验分享)