pgfplotstable 右侧缺少边框/垂直线

pgfplotstable 右侧缺少边框/垂直线

我尝试了 pgfplotstable 的许多选项,但无法生成右侧边框。(此表必须能够跨越多页。)有什么想法吗?谢谢!(我正在使用 TexMake 中的 Quick Build 来生成 pdf。)

\documentclass[12pt]{article}
\usepackage{pgfplotstable,pgfplots}
\usepackage{booktabs}
\usepackage{filecontents}
\usepackage[top=1.3in,left=1.0in]{geometry}
\usepackage{longtable}
%\usepackage{siunitx}
\usepackage{hhline}
\usepackage{array}
\usepackage{tabularx,ragged2e}
\usepackage{varwidth}

\begin{filecontents*}{rel_list.csv}
Document Title,Release Date,Change Description
VERSION (TB04),27-Aug-11,Version 04 (TB04) Update/Release
VERSION (TB05),27-Sep-12,Version 05 (TB05) Update/Release
VERSION (TB06),8-Nov-12,Version 06 (TB06) Update/Release
VERSION (TB07),14-Dec-12,Version 07 (TB07) Update/Release
VERSION (TB08),15-Feb-13,Incorporate R-LIB comments from TB06
,,Version 08 (TB08) Update/Release
VERSION (TB09),5-Apr-13,Version 09 (TB09) Update/Release
VERSION (TB10),24-May-13,Version 10 (TB10) Update/Release
VERSION (ER1204),12-Jun-13,ER1204 support for EASY DOC 4.5f
,,TB11 requirements not covered by ER1204
,,ER1204 Update/Release
VERSION (TB11),19-Jul-13,Version 11 (TB11) Update/Release
VERSION (TB12),4-Oct-13,Version 12 (TB12) Update/Release
VERSION (TB13),11-Apr-14,Version 13 (TB13) Update/Release
VERSION (TB15),7-Jul-14,Version 14 (TB15) Update/Release
VERSION (TB15),22-Sep-14,Version 15 (TB15) Update/Release
VERSION (TB16),19-Dec-14,Major revisions to reflect transition to fully automated requirements testing
,,Version 16 (TB16) Update/Release
VERSION (TB17),29-May-15,Version 17 (TB17) Release
VERSION (TB18 ER),4-Jan-16,Version 18 (TB18) Pre-Release
VERSION (TB18.0),12-Feb-16,Version 18 (TB18.0) Update/Release
VERSION (TB19 ER),30-Jun-16,Version 19 (TB19 ER) Pre-Release
VERSION (TB19.0.0),12-Aug-16,Version 19 (TB19.0) Update/Release
VERSION (TB20 ER),16-Dec-16,Version 20 (TB20 ER) Update/Release
VERSION (TB20.0.0),30-Mar-17,Version 20(TB20.0.0) Update/Release
VERSION (TB20.1.0),30-Jun-17,Version 20.1 (TB20.1.0) Contextual Update
VERSION (TB20.2.0),29-Sep-17,Version 20.2 (TB20.2.0) Contextual Update and EASY DOC 5.3
VERSION (TB20.3.0),22-Dec-17,Version 20.3 (TB20.3.0) Contextual Update and LIDD 8.9.0
VERSION (TB20.4.0),28-Mar-18,Version 20.4 (TB20.4.0) Contextual Update
VERSION (TB09),5-Apr-13,Version 09 (TB09) Update/Release
VERSION (TB10),24-May-13,Version 10 (TB10) Update/Release
VERSION (ER1204),12-Jun-13,ER1204 support for EASY DOC 4.5f
,,TB11 requirements not covered by ER1204
,,ER1204 Update/Release
VERSION (TB11),19-Jul-13,Version 11 (TB11) Update/Release
VERSION (TB12),4-Oct-13,Version 12 (TB12) Update/Release
VERSION (TB13),11-Apr-14,Version 13 (TB13) Update/Release
VERSION (TB15),7-Jul-14,Version 14 (TB15) Update/Release
VERSION (TB15),22-Sep-14,Version 15 (TB15) Update/Release
VERSION (TB16),19-Dec-14,Major revisions to reflect transition to fully automated requirements testing
,,Version 16 (TB16) Update/Release
VERSION (TB17),29-May-15,Version 17 (TB17) Release
VERSION (TB18 ER),4-Jan-16,Version 18 (TB18) Pre-Release
VERSION (TB18.0),12-Feb-16,Version 18 (TB18.0) Update/Release
VERSION (TB19 ER),30-Jun-16,Version 19 (TB19 ER) Pre-Release
VERSION (TB19.0.0),12-Aug-16,Version 19 (TB19.0) Update/Release
VERSION (TB20 ER),16-Dec-16,Version 20 (TB20 ER) Update/Release
\end{filecontents*}


%------ SET FONT TO ARIAL LOOK-ALIKE
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial

\pgfplotsset{compat=1.14}
\showboxbreadth=5

\begin{document}
    \centering
    \pgfplotstableread[col sep=comma]{rel_list.csv}\data

     \pgfplotstabletypeset[
            string type,
            every head row/.style={before row={\toprule\hhline{|-|-|-|}},after row={\midrule}},
                begin table=\begin{longtable},
                every first row/.append style={before row={%
                Document Title  & Release Date & Change Description  \\ \toprule\hhline{|-|-|-|}
                \endfirsthead%
                \hhline{|-|-|-|}
            \hhline{|-|-|-|}
                    Document Title  & Release Date  & Change Description \\ \hhline{|-|-|-|}
                \endhead
                    \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
                \endfoot
                    \bottomrule
%               \multicolumn{3}{|r|}{{Concluded}} \\ \hline
                \endlastfoot
        }},%
        end table=\end{longtable},
        %
        column type/.add={|}{},
        display columns/2/.style={column type={p{.5\textwidth}}},
%        empty cells with={--}, %replace empty cells with "--"
%        \setlength{\extrarowheight}{\myhe}
        %every last column/.style={%
        %  column type/.add={}{|}},
        columns/Document Title/.style={column type=|l|},
        columns/Release Date/.style={column type=c|},
        columns/Change Description/.style={column type=|l|},
        every head row/.style={after row=\hline,output empty row},
        columns={Document Title,Release Date,Change Description},%
%       every nth row={1}{before row=\midrule}
       every nth row={1}{before row=\hhline{|-|-|-|},after row=\hhline{|-|-|-|}},
]{\data}
\end{document}

答案1

请尝试以下操作:

\documentclass[12pt]{article}
\usepackage{pgfplotstable,pgfplots}
\usepackage{booktabs}
\usepackage{filecontents}
\usepackage[top=1.3in,left=1.0in]{geometry}
\usepackage{longtable}
%\usepackage{siunitx}
\usepackage{hhline}
\usepackage{array}
\usepackage{tabularx,ragged2e}
\usepackage{varwidth}

\begin{filecontents*}{rel_list.csv}
Document Title,Release Date,Change Description
VERSION (TB04),27-Aug-11,Version 04 (TB04) Update/Release
VERSION (TB05),27-Sep-12,Version 05 (TB05) Update/Release
VERSION (TB06),8-Nov-12,Version 06 (TB06) Update/Release
VERSION (TB07),14-Dec-12,Version 07 (TB07) Update/Release
VERSION (TB08),15-Feb-13,Incorporate R-LIB comments from TB06
,,Version 08 (TB08) Update/Release
VERSION (TB09),5-Apr-13,Version 09 (TB09) Update/Release
VERSION (TB10),24-May-13,Version 10 (TB10) Update/Release
VERSION (ER1204),12-Jun-13,ER1204 support for EASY DOC 4.5f
,,TB11 requirements not covered by ER1204
,,ER1204 Update/Release
VERSION (TB11),19-Jul-13,Version 11 (TB11) Update/Release
VERSION (TB12),4-Oct-13,Version 12 (TB12) Update/Release
VERSION (TB13),11-Apr-14,Version 13 (TB13) Update/Release
VERSION (TB15),7-Jul-14,Version 14 (TB15) Update/Release
VERSION (TB15),22-Sep-14,Version 15 (TB15) Update/Release
VERSION (TB16),19-Dec-14,Major revisions to reflect transition to fully automated requirements testing
,,Version 16 (TB16) Update/Release
VERSION (TB17),29-May-15,Version 17 (TB17) Release
VERSION (TB18 ER),4-Jan-16,Version 18 (TB18) Pre-Release
VERSION (TB18.0),12-Feb-16,Version 18 (TB18.0) Update/Release
VERSION (TB19 ER),30-Jun-16,Version 19 (TB19 ER) Pre-Release
VERSION (TB19.0.0),12-Aug-16,Version 19 (TB19.0) Update/Release
VERSION (TB20 ER),16-Dec-16,Version 20 (TB20 ER) Update/Release
VERSION (TB20.0.0),30-Mar-17,Version 20(TB20.0.0) Update/Release
VERSION (TB20.1.0),30-Jun-17,Version 20.1 (TB20.1.0) Contextual Update
VERSION (TB20.2.0),29-Sep-17,Version 20.2 (TB20.2.0) Contextual Update and EASY DOC 5.3
VERSION (TB20.3.0),22-Dec-17,Version 20.3 (TB20.3.0) Contextual Update and LIDD 8.9.0
VERSION (TB20.4.0),28-Mar-18,Version 20.4 (TB20.4.0) Contextual Update
VERSION (TB09),5-Apr-13,Version 09 (TB09) Update/Release
VERSION (TB10),24-May-13,Version 10 (TB10) Update/Release
VERSION (ER1204),12-Jun-13,ER1204 support for EASY DOC 4.5f
,,TB11 requirements not covered by ER1204
,,ER1204 Update/Release
VERSION (TB11),19-Jul-13,Version 11 (TB11) Update/Release
VERSION (TB12),4-Oct-13,Version 12 (TB12) Update/Release
VERSION (TB13),11-Apr-14,Version 13 (TB13) Update/Release
VERSION (TB15),7-Jul-14,Version 14 (TB15) Update/Release
VERSION (TB15),22-Sep-14,Version 15 (TB15) Update/Release
VERSION (TB16),19-Dec-14,Major revisions to reflect transition to fully automated requirements testing
,,Version 16 (TB16) Update/Release
VERSION (TB17),29-May-15,Version 17 (TB17) Release
VERSION (TB18 ER),4-Jan-16,Version 18 (TB18) Pre-Release
VERSION (TB18.0),12-Feb-16,Version 18 (TB18.0) Update/Release
VERSION (TB19 ER),30-Jun-16,Version 19 (TB19 ER) Pre-Release
VERSION (TB19.0.0),12-Aug-16,Version 19 (TB19.0) Update/Release
VERSION (TB20 ER),16-Dec-16,Version 20 (TB20 ER) Update/Release
\end{filecontents*}


%------ SET FONT TO ARIAL LOOK-ALIKE
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial

\pgfplotsset{compat=1.14}
\showboxbreadth=5

\begin{document}
    \centering
    \pgfplotstableread[col sep=comma]{rel_list.csv}\data

     \pgfplotstabletypeset[
            string type,
            every head row/.style={before row={,
                                   after row={\hhline{|-|-|-|}\midrule[\heavyrulewidth]}},
                begin table=\begin{longtable},
                every first row/.append style={before row={%
                \hhline{|-|-|-|}
                \endfirsthead%
                \hhline{|-|-|-|}
                    Document Title  & Release Date  & Change Description \\ \hhline{|-|-|-|}
                    \midrule[\heavyrulewidth]
                    \hhline{|-|-|-|}
                \endhead
                    \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
                \endfoot
                    \bottomrule
                \endlastfoot
        }},%
        end table=\end{longtable},
        %
        display columns/0/.style={column type={|p{.25\textwidth}|}},
        display columns/1/.style={column type={r|}},
        display columns/2/.style={column type={p{.5\textwidth}|}},
        every nth row={1}{before row=\hhline{|-|-|-|},
                          after  row=\hhline{|-|-|-|}},
]{\data}
\end{document}

在此处输入图片描述

相关内容