表格排版

2021-02-07 15:01发布

``` \begin{table}[H] \centering \small \begin{tabular}{|p{80pt}

``` \begin{table}[H] \centering \small \begin{tabular}{|p{80pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|} \hline \multicolumn{5}{c}{Details of fund application items}\\ \cmidrule{1-5} \hline \rowcolor{grey} 1 & 2&3 &4&5s\cr \hline 1&2&3&4&5\\ \hline \end{tabular} \end{table} ```## 编译环境 操作系统 * [ ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [ ] TexLive `年份` * [ ] MikTeX `版本号` * [ ] CTeX `若需勾选,请把[ ]改成[x]` ## 我的问题 第一行为跨列表格,但是编译成功第一行左右两边边框消失,且灰色未铺满表格![](https://wenda.latexstudio.net/data/attach/210207/jlVH34Yl.png)
2条回答
Banach spaces
2021-02-07 15:13
您好!\cmidrule对颜色填充会导致铺不满:可以用\cline避免这个问题: ```c \documentclass[fontset=none]{ctexart} \usepackage[margin=2.5cm]{geometry} \usepackage{newtxtext} \usepackage{graphicx} \usepackage{booktabs,colortbl} \usepackage{xcolor} \begin{document} \begin{table}[htpb] \centering \small \begin{tabular}{|p{80pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|p{60pt}<{\centering}|} \hline \multicolumn{5}{|c|}{Details of fund application items}\\ \cline{1-5} \hline \rowcolor{gray} 1 & 2&3 &4&5s\\ \hline 1&2&3&4&5\\ \hline \end{tabular} \end{table} \end{document} ``` 结果是这样的: ![](https://wenda.latexstudio.net/data/attach/210207/tdHjGeLK.jpg)

一周热门 更多>