[Tex/LaTex] tree list in a table

dirtreeliststablestrees

I would like to put a tree list into a table environment. Smth. like:

+--------------------------+---------------------------+-------------+
| Heading 1                |  Heading 2                | Heading 3   |
+--------------------------+---------------------------+-------------+
| / main-item              |  main item data           | some info   |
|   +-- sub item 1         |  sub item 1 data          | some info 1 |
|   |   +-- sub sub item x |  sub sub item 1.x data    | some info x |
|   |                      |                           |             |
|   +-- sub item 2         |  sub item 2 data          | some info 2 |
|       +-- sub sub item y |  sub sub item 2.y data    | some info y |
+--------------------------+---------------------------+-------------+

I know about dirtree package, but it it possible to arrange dirtree data in that way?

P.S.: I received multiple answers to this question, which solve the problem. I personally found the accepted answer more appropriate in my case. But here are also answers how to achieve the requested functionality with dirtree package. Therefore I encourage everyone to read all answers to find the best possible solution.

Best Answer

Here an example how you can mimic that with pure table environment. But you don't have connections between sub-items.

Hope that helps anyway.

\begin{table}[p]
\begin{center}
    \caption{Some caption of your table} \label{tab:trendtable}
    \begin{tabular}{lll}
    \midrule[1pt]
    \multicolumn{1}{c} {Heading 1} & \multicolumn{1}{c}{Heading 2} & \multicolumn{1}{c} {Heading 3} \\ 
    \midrule[1pt]
    \textbf{main-item}             & main item data        & some info\\
    \hspace{0.2cm} sub item 1      & sub item 1 data       & some info 1 \\
    \hspace{0.4cm} sub sub item x  & sub item 1.x          & some info x \\
    &&\\
    \textbf{main-item 2}           & ...                   & ...\\
    \hspace{0.2cm} ...             & ...                   & ... \\
    \end{tabular}
\end{center}
\end{table} 

compiled code as an image

Related Question