请问怎么制作这样的表格?

2019-11-14 09:59发布

[图]\documentclass[a4paper]{ctexart}\usepackage{colortbl}\usepackage{xcolor}\usepackage{makecell}\usepac...


\documentclass[a4paper]{ctexart}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{makecell}
\usepackage{array}
\usepackage{longtable}

\begin{document}
\begin{tabular}{c|c|c|c|c|c}
\hline
\rowcolor{yellow} 检测基因&NFE2L2&NQO1&SOD2&CAT&\
\hline
\multicolumn{6}{c}{}
\ \hline
\rowcolor{yellow} 结 果&TT&GG&AA&CC&\
\hline
\end{tabular}
\end{document}

这是我的代码

只能做成这样,两边不能圆圆的
谢谢各位大佬

3条回答
论坛 github.com/C
2019-11-14 14:50
仍然是一个用 `tcolorbox` 的方案,做了一定的抽象。凑合吧 如果完全使用表格来做,需要 patch 很底层的实现。 ```tex \documentclass{ctexart} \usepackage[table]{xcolor} % load colortbl package \usepackage{tcolorbox} \tcbuselibrary{hooks} % allow use of option "before upper pre" \makeatletter \tcbset{ rounded tabular/.style={ tabulars={*{5}{c|}}, % preamble of "{tabular*}" env colback=magenta!30, % background color arc=0.8em, % radius of arc, magic number width=0.8\linewidth, % total width set all rules=0.6pt % width of frame rule and tabular vrule }, set all rules/.style={ boxrule=#1, before upper pre={% \setlength{\arrayrulewidth}{#1}% } } } \makeatother \newtcolorbox{rtabular}[1][]{ rounded tabular/.append style={#1}, rounded tabular } \begin{document} \tcbset{ rounded tabular/.append style={ tabulars={ *{2}{>{\centering}p{4em}|} *{3}{>{\centering}p{3em}|} }, width=0.9\linewidth, set all rules=0.6pt } } \begin{rtabular} 检测基因 & NFE2L2 & NQO1 & SOD2 & CAT \end{rtabular} \begin{rtabular} 检\qquad 因 & NFE & NO & SO & C \end{rtabular} \end{document} ``` ![](https://pics.latexstudio.net/data/images/201911/97303eb2a3966c7.png)

一周热门 更多>