MLK

原文来自:http://blog.sina.com.cn/s/blog_5e16f1770100h6jl.html

 

解决方案:使用宏包multirow,提供了如下命令:参看http://www.ctan.org/tex-archive/macros/latex/contrib/multirow/

效果图:
LaTeX技巧286:表格合并行的绘制技巧

演示代码:
\documentclass{article}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{multirow}
\begin{document}
\begin{longtable}{| c | c | c | c  | c | c |}
    \hline
    & \multicolumn{5}{| c |}{ } \\
    & \multicolumn{5}{| c |}{\textbf{\large Father's Occupation}} \\
    & \multicolumn{5}{| c |}{ } \\
    \hline
    & & & & & \\
    \multicolumn{1}{|c|}{\textbf{}}
    &  \multicolumn{1}{|c|}{\textbf{}}
    &  \multicolumn{1}{c|}{\textbf{Group A}}
    &  \multicolumn{1}{c|}{\textbf{Group B}}
    &  \multicolumn{1}{c|}{\textbf{Group C}}
    &  \multicolumn{1}{c|}{\textbf{Group D}} \\
    & & & & & \\
     \cline{2-6}
    & & & & & \\
    \multirow{5}{*}{\begin{sideways}{\textbf{\large Mother's Occupation}}\end{sideways}}
    &   \textbf{Group A}   &   $8$      &   $3$      &   $4$      &   $1$   \\
    & & & & & \\
    \cline{2-6}
    & & & & & \\
   &   \textbf{Group B}   &   $3$      &   $3$      &   $0$      &   $1$   \\
    & & & & & \\
     \cline{2-6}
    & & & & & \\
    &   \textbf{Group C}   &   $0$      &   $0$      &   $1$      &   $0$   \\
    & & & & & \\
     \cline{2-6}
    & & & & & \\
    &   \textbf{Group D}   &   $2$      &   $0$      &   $0$      &   $1$   \\
    & & & & & \\
    \hline
    & & & & & \\
    &   \textbf{Total:}      &   \textbf{26}   &   \textbf{10}   &   \textbf{10}   &   \textbf{4}    \\
    & & & & & \\
    \hline
    \end{longtable}
  
  
    \end{document}

posted on 2012-05-31 21:14  emy_yu  阅读(3007)  评论(0编辑  收藏  举报