\hline 划线命令,只能用在第一行的前面或者\\(空行)的后面
\cline{n-m} 画一条从n列到m列的水平线
\vline 画一个竖线,高度等于行高。这样可以得到一个并非贯穿上下的竖线。
\multicolumn{ 数 }{ 列 }{ 文 本 } 只能位于一个列分隔符(&)的后面,或者某一行的开始。也就是把数个列合并成一个列。内容表格中需要插入的内容。
使用multirow之前,一定要在添加宏包的区域添加上宏包,否则是无法运行的!\usepackage{multirow}
\begin{tabular}{|l|l|l|l|} \hline\multirow{4}{2cm}{This is a demo table} & C2a & \multirow{4}{2cm}{This is another one} & C4a\\ & C2b & & C4b\\ & C2c & & C4c\\ & C2d & & C4d\\ \hline \end{tabular}
\begin{tabular}{c c c c c c c c }\hline\multirow{2}{1cm}{$\beta$}\multirow{2}{1cm}{n}&~&a&~&~&b&~&\\\cline{2-8} &1&2&3&4&5&6&\\ \hline % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ... \multirow{4}{2cm} {1.1} &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ \hline % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ... \multirow{4}{2cm} {1.5} &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ \hline % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ... \multirow{4}{2cm} {1.9} &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ &1&2&3&4&5&6\\ \hline\end{tabular}
\begin{tabular}{ |l|l| } \hline \multicolumn{2}{|c|}{Team sheet} \\ \hline GK & Paul Robinson \\ LB & Lucas Radebe \\ DC & Michael Duberry \\ DC & Dominic Matteo \\ RB & Dider Domi \\ MC & David Batty \\ MC & Eirik Bakke \\ MC & Jody Morris \\ FW & Jamie McMaster \\ ST & Alan Smith \\ ST & Mark Viduka \\ \hline \end{tabular}