1

I am using csvreader to import a csv file and display it as a table. The first column contains strings that are very long and so the column takes up most of the page, meaning the table continues off the page. Is there a way to force a cell value to continue on the next line? I don't mind if it is hyphenated or not, but it would be great if I could specify a max length for the first column and the strings wrap if they are too long. Example code below:

    \documentclass{report}

    \usepackage{csvsimple}

    \begin{filecontents}{test.csv}
    LongString,ColA,ColB,ColC
    ABCDEFGHIJKLMABCDEFGHIJKLMABCDEFGHIJKLMABCDEFGHIJKLM,12345,23456,34567
    NOPQRSTUVWXYZNOPQRSTUVWXYZNOPQRSTUVWXYZNOPQRSTUVWXYZ,45678,56789,67890
    \end{filecontents}

    \begin{document}

    \begin{table}
    \csvreader[
        tabular=|c|c|c|c|,
        column count=4,
        table head=\hline,
        table foot=\hline,
        no head,
        late after first line=\\\hline,
        respect all
    ]{test.csv}{}{\csvlinetotablerow}
    \end{table}

    \end{document}
LEJ
  • 133

0 Answers0