加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

LaTeX技巧272:表格合并列的细节问题

(2010-02-05 19:34:18)
标签:

latex

table

合并列

细节

技巧

分类: 表格制作

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

请看如下代码:
\begin{table}
\centering
\begin{tabular}{ll||ccc|ccc|ccc||c|c}
\hline
&& \multicolumn{6}{c}{experiments} & \multicolumn{3}{c}{simulation} & x & y \\
\hline
1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
\end{tabular}
\end{table}
貌似没有什么问题,但是运行结果却是如图中箭头所示:
LaTeX技巧272:表格合并列的细节问题
修改意见如下:
\begin{table}[!ht]
      \centering
      \begin{tabular}{ll||ccc|ccc|ccc||c|c} \hline
        & & \multicolumn{6}{c}{experiments} & \multicolumn{3}{c||}{simulation} & x & y \\\hline
        1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
        1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
      \end{tabular}
    \end{table}
原因是multicolumn吞掉了后面的画线命令。
演示效果图:
LaTeX技巧272:表格合并列的细节问题
演示代码:
    \documentclass{article}
   
    \begin{document}
    \begin{table}
    \centering
    \begin{tabular}{ll||ccc|ccc|ccc||c|c}
    \hline
    && \multicolumn{6}{c}{experiments} & \multicolumn{3}{c}{simulation} & x & y \\
    \hline
    1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
    1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
    \end{tabular}
    \end{table}

    \begin{table}[!ht]
      \centering
      \begin{tabular}{ll||ccc|ccc|ccc||c|c} \hline
        & & \multicolumn{6}{c}{experiments} & \multicolumn{3}{c||}{simulation} & x & y \\\hline
        1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
        1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
      \end{tabular}
    \end{table}
    \end{document}

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有