我正在尝试在工作中添加一个表格。我在上面画了一个带红色边框的矩形,以显示我想要放置长列的位置。然后,我得到了这些错误,如果我解决它们,表格渲染就会变得一团糟。
我的代码:
{\renewcommand{\arraystretch}{1.6}%
\small
\begin{table}[H]
\small
\centering
\caption{}\label{tab:blockchains}
\scalebox{0.97}{
\begin{tblr}{colspec={l *{5}{X[c,m]}},
rows = {font=\linespread{1}\selectfont},
row{1} = {},
hline{1} = {2-7}{solid},
hline{2-7} = {solid},
vline{1} = {2-7}{solid},
vline{2-7} = {solid}
}
\SetCell[c=1]{c,white}
\multicolumn{1}{l|}{} & Platform & Memory & Specification & Price \\
\multicolumn{1}{|l|}{} & Windows & 16GB & Whatever & 10K \\
\multicolumn{1}{|l|}{} & Windows, 32GB & Professional & 22K \\
\multicolumn{1}{|l|}{} & Linux, 64GB & Hacker IBM & 32K \\
\end{tblr}}
\end{table}}
答案1
这些冒犯\multicolumn
看起来是没有必要的,只需将其删除:
\documentclass{article}
\usepackage{tabularray}
\usepackage{xcolor}
\begin{document}
\begin{tblr}{colspec={l *{4}{X[c,m]}},
hline{1-2} = {2-Z}{solid,red},
hline{3-Z} = {solid},
vline{1} = {3-Z}{solid},
vline{2-Z} = {solid},
vline{2-Z} = {1}{solid,red},
}
& \SetCell[c=4]{}\\
& Platform & Memory & Specification & Price \\
& Windows & 16GB & Whatever & 10K \\
& Windows, 32GB & Professional & 22K \\
& Linux, 64GB & Hacker IBM & 32K \\
\end{tblr}
\end{document}