LaTeX技巧653:如何隔开LaTeX表格邻近\cline表格线? |
您所在的位置:网站首页 › 表格横线怎么隐藏 › LaTeX技巧653:如何隔开LaTeX表格邻近\cline表格线? |
原文链接:http://www.latexstudio.net/archives/700.html LaTeX制作表格,若是需要做局部画线的表格,会用到如下的命令\cline,示例如下: 代码如下: \begin{tabular}{lrrrrrrr} \hline \multicolumn{2}{c}{level1} \multicolumn{2}{c}{level2} \multicolumn{2}{c}{level3} \\ \cline{3-8} type ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 \\ \hline Section ; 2.3 ; 2.288 ; 0.009 ; 1.779 ; 0.008 ; 0.338 ; 2.1\\ Period ; 2.8 ; 3.309 ; 0.002 ; 4.060 ; 0.000 ; 0.866 ; 2.3\\ \hline \end{tabular}若是我们需要的效果是: 用下面的代码: \begin{tabular}{lrrrrrrr} \hline ; ; \multicolumn{2}{c}{level1} ; \multicolumn{2}{c}{level2} ; \multicolumn{2}{c}{level3} \\ \cline{3-4} \cline{5-6} \cline{7-8} type ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 \\ \hline Section ; 2.3 ; 2.288 ; 0.009 ; 1.779 ; 0.008 ; 0.338 ; 2.1\\ Period ; 2.8 ; 3.309 ; 0.002 ; 4.060 ; 0.000 ; 0.866 ; 2.3\\ \hline \end{tabular}显示的效果仍旧是上面的表格效果。 【解决方案】 我们可以使用booktabs里所提供的命令\cmidrule 命令,上面的效果实现的代码如下: \begin{tabular}{lrrrrrrr} \hline ; ; \multicolumn{2}{c}{level1} ; \multicolumn{2}{c}{level2} ; \multicolumn{2}{c}{level3} \\ \cmidrule(r){3-4} \cmidrule(r){5-6} \cmidrule(r){7-8} \noalign{\smallskip} type ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 \\ \hline Section ; 2.3 ; 2.288 ; 0.009 ; 1.779 ; 0.008 ; 0.338 ; 2.1\\ Period ; 2.8 ; 3.309 ; 0.002 ; 4.060 ; 0.000 ; 0.866 ; 2.3\\ \hline \end{tabular} |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |