带有 dec sep align 和 Tabularx 的 Pgfplotstable 多列表格

带有 dec sep align 和 Tabularx 的 Pgfplotstable 多列表格

我想用 Pgfplotstable 实现一个多列表格,一方面通过 dec sep align 对齐列数,另一方面通过 Tabularx 对齐整个表。下面是没有 Tabularx 的版本:

不使用 Tabularx 的示例

有人问过类似的问题十进制九月对齐和\多列不兼容?和这里使用 pgfplotstable 设置表格宽度。然而,两者的组合从未被要求过,而且似乎会通过生成错误消息(放错位置的 noalign)造成麻烦。

当前表的示例代码如下:

\pgfplotstabletypeset[
    col sep=comma, 
    header=false,
    % column type=,
    % begin table={\begin{tabularx}{\textwidth}{XXXXXXXXXX}},
    % end table={\end{tabularx}},
    every head row/.style={
        before row={\toprule%
            \multicolumn{1}{l}{Test Case}  & 
            \multicolumn{6}{c}{Extraction Times (ms)} & 
            \multicolumn{6}{c}{Nr. of Nodes} &  
            \multicolumn{6}{c}{Nr. of Edges}\\
        }, after row={\midrule}
    },
    every last row/.style={after row=\bottomrule},
    display columns/0/.style={column name={}, string type, column type={l}},
    display columns/1/.style={column name={Avg.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/2/.style={column name={Min.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/3/.style={column name={Max.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/4/.style={column name={Avg.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/5/.style={column name={Min.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/6/.style={column name={Max.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/7/.style={column name={Avg.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/8/.style={column name={Min.}, fixed, fixed zerofill, precision=3, dec sep align={l}},
    display columns/9/.style={column name={Max.}, fixed, fixed zerofill, precision=3, dec sep align={l}},                         
]
{
1,0.9010122055414193,0.026615,63.07629,77.97766468758836,25,237,76.97766468758836,24,236
2,0.8516347167090754,0.015717,98.322158,29.500989539157477,9,86,28.500989539157477,8,85
3,0.8279668317783433,0.012067,46.588329,15.549901046084253,5,44,14.549901046084253,4,43
4,0.8110630712468193,0.010986,46.879446,10.682499293186316,4,30,9.682499293186316,3,29
}

我已经将 tabularx 的列数更改为 doc sec align 需要两列,但没有成功。

非常感谢任何建议和解决方案。

相关内容