我已经使用了论文模板,但我想插入一个表格,就像我在 word 中所做的那样。但你知道,这根本做不到。所以我只想插入一个最相似的表格。图片是我在 word 中的表格,我在 LaTeX 中所做的是:
\newcommand\fontcolor{}
\begin{center}
\setlength{\arrayrulewidth}{2pt}
\arrayrulecolor{white} % Color of all vertical lines.
\begin{tabular}[H]{|l|l|c|} % left | center | right for each line.
\arrayrulecolor{white}\hline % Color of the first(top) horizontal line.
\rowcolor[rgb]{0.30980, 0.50588, 0.73725}
\noalign{\gdef\fontcolor{\color{white}}}
% Font color in 1st row.
Feature & Format & NO.\\
\arrayrulecolor{white}\hline % Color of the second horizontal line.
\rowcolor[rgb]{0.82353, 0.87843, 0.92941}
\noalign{\gdef\fontcolor{\color{}}} % Fon color in other Row
France & Paris & Seine \\
\arrayrulecolor{white}\hline%\cline{1-1} % Color of the 3rd line for the 1st grid.
Russia & Moscow & Moskva \\
\arrayrulecolor{white}%\cline{2-3} % Color of the 4th line and last grid of the 3rd line.
\end{tabular}
\end{center}
我搜索并查看了几篇帖子。但没有一篇有用。有人能帮忙吗?
答案1
请始终发布显示所有使用过的软件包的完整文档。我猜是colortbl
在这里。
请注意,没有H
选项tabular
。
\documentclass{article}
\usepackage{colortbl,hhline}
\definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}
\definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}
\begin{document}
\begin{center}
\setlength{\arrayrulewidth}{2pt}
\setlength{\extrarowheight}{1pt}
\color{c1}
\arrayrulecolor{white}
\begin{tabular}{|l|l|c|}
\hline
\rowcolor{c1}
\color{c2}Feature &
\color{c2}Format &
\color{c2}NO.\ \\
\hline %added \\ here
\rowcolor{c2}
France & Paris & Seine \ \\
\hline %added \\ here
\rowcolor{c2}
Russia & Moscow & Moskva \\
\hline
\end{tabular}
\end{center}
\end{document}