I am trying to nest a tabularx
table into a cell of another tabularx
table. I did it according to the Question here. Now my problem is, that they use the \newcolumntype{Y}{>{\centering\arraybackslash}X}
column type, which does not allow to specify the width of the columns.
My definitions look like this:
\newcolumntype{R}[1]{>{\raggedleft\hsize=#1\hsize\arraybackslash}X}%
\newcolumntype{L}[1]{>{\raggedright\hsize=#1\hsize\arraybackslash}X}%
\newcolumntype{C}[1]{>{\centering\hsize=#1\hsize\arraybackslash}X}
If I use one of them, the nested table will overflow the cell. Do you have any idea how I could fix this?
MWE:
\documentclass[10pt,notitlepage]{article}%
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{array}
\usepackage{minted}
\newcolumntype{L}[1]{>{\raggedright\hsize=#1\hsize\arraybackslash}X}
\begin{document}
\begin{table}[H]
\centering
\begin{tabularx}{\linewidth}{L{0.6}L{1.4}}
\toprule
\textbf{Command} & \textbf{Description} \\
\midrule
\mintinline{console}{pwd} & Print name of current working directory test trest \\
\mintinline{console}{cd} & {
Change directory
\newline
\begin{tabularx}{\cellwidth}{L{0.8}L{1.2}}
\toprule
\mintinline{console}{~} & current users home directory \\
\mintinline{console}{~bob} & bobs' home direcotry \\
\mintinline{console}{-} & previous directory \\
\bottomrule
\end{tabularx}
} \\
\bottomrule
\end{tabularx}
\caption{Basics}
\end{table}
\end{document}
How can I extend the nested table to the edge of the cell?
\hize
s must equal the number ofX
columns, so that, for instance, in the nested tabularx, the coefficients should be0.6
and1.4
.L{0.5}L{0.5}
is simplyXX
.\mintinline
macro defined?\usepackage{minted}
package