我希望将 ColHead6-ColHead10 列放在第一组五列之下(当然,第一列仍然在左侧)。我该怎么做?
我可以\multicolumn{6}{c}{Dataset 2}
在堆叠/转换的列之间使用它吗?
平均能量损失
\documentclass{scrartcl}
\usepackage{pgfplotstable}
\begin{filecontents}{data.txt}
Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10
A,17,19,15,17,3,8,14,7,8,14
B,10,8,11,15,10,8,6,13,13,10
C,20,5,16,12,8,5,16,7,14,17
D,14,4,10,14,16,14,5,10,5,11
\end{filecontents}
\pgfplotstableread[col sep=comma]{data.txt}{\mydata}
\begin{document}
\begin{center}
\pgfplotstabletypeset[columns/Word/.style={string type}]{\mydata}
\end{center}
\end{document}
答案1
\documentclass{scrartcl}
\usepackage{pgfplotstable}
\begin{filecontents}{data.txt}
Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10
A,17,19,15,17,3,8,14,7,8,14
B,10,8,11,15,10,8,6,13,13,10
C,20,5,16,12,8,5,16,7,14,17
D,14,4,10,14,16,14,5,10,5,11
\end{filecontents}
\pgfplotstableread[col sep=comma]{data.txt}{\mydata}
\begin{document}
\begin{center}
data set 1
\pgfplotstabletypeset[columns/Word/.style={string type},
columns={Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5}]{\mydata}
data set 2
\pgfplotstabletypeset[columns/Word/.style={string type},
columns={Word,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10}]{\mydata}
\end{center}
\end{document}