``` \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 回答2

1
```perl \documentclass{article} \usepackage{colortbl} \usepackage{xcolor} \begin{document} \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}\\ \hline \rowcolor{gray} 1 & 2&3 &4&5s\\ \hline 1&2&3&4&5\\ \hline \end{tabular} \end{table} \end{document} ``` 给出的示例代码中有这么多用不到的命令,为什么不看一下代码再上来问呢,多浪费回答人(会打人)的时间
0
您好!\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)

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。