![箭頭解釋表頭](https://rvso.com/image/392323/%E7%AE%AD%E9%A0%AD%E8%A7%A3%E9%87%8B%E8%A1%A8%E9%A0%AD.png)
答案1
繪製這個並不難,但是從螢幕截圖中輸入所有這些內容很乏味(這就是為什麼我剛剛添加can 1
等等,您可以用您認為更合適的任何內容替換這些文字)。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit,positioning}
\begin{document}
\begin{tikzpicture}[font=\sffamily,node distance=2pt and 4pt]
\begin{scope}[local bounding box=top]
\node (c1) {d};
\node[right=of c1] (c2) {l};
\node[fit=(c1) (c2),label=above:type]{};
\node[right=1cm of c2] (c3) {r};
\node[right=of c3] (c4) {w};
\node[right=of c4] (c5) {x};
\node[fit=(c3) (c5),label=above:users]{};
\node[right=1cm of c5] (c6) {r};
\node[right=of c6] (c7) {w};
\node[right=of c7] (c8) {x};
\node[fit=(c6) (c8),label=above:groups]{};
\node[right=1cm of c8] (c9) {r};
\node[right=of c9] (c10) {w};
\node[right=of c10] (c11) {x};
\node[fit=(c9) (c11),label=above:others]{};
\end{scope}
\foreach \X [count=\Y,evaluate=\Y as \Z using {int(12-\Y)},
remember=\Z as \LastZ]
in {can 1,can 2,can 3,can 4,can 5,can 6,can 7,can 8,can 9,can 10,can 11}
{\ifnum\Y=1
\node[anchor=north west] (l\Z) at ([xshift=1em,yshift=-1ex]top.south east)
{\X};
\else
\node[anchor=north west] (l\Z) at ([yshift=-0.2ex]l\LastZ.south west) {\X};
\fi
\draw[latex-] (c\Z) |- (l\Z);
}
\end{tikzpicture}
\end{document}
答案2
我提出了一種完全不同的佈局,僅使用\tablenotes
fromthreeparttable
與顏色相結合,在我看來,這與箭頭一樣具有表現力:
\documentclass[11pt]{article}
\usepackage{array, threeparttable, booktabs}
\usepackage[svgnames]{xcolor}
\newcommand{\dir}{\textcolor{Goldenrod}d}
\newcommand{\syl}{\textcolor{LightSteelBlue}l}
\newcommand{\rd}{\textcolor{Salmon}r}
\newcommand{\wri}{\textcolor{Gold}w}
\newcommand{\exc}{\textcolor{YellowGreen}x}
\begin{document}
\begin{table}[!htbp]
\centering\sffamily
\begin{threeparttable}
\caption{Table}
\label{}
\begin{tabular}{*{4} {>{\centering\arraybackslash}p{1.2cm}}}
\toprule
type & users & group & others \\
\cmidrule(lr){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}
\dir \enspace\syl & \rd\enspace\wri\enspace\exc & \rd\enspace\wri\enspace\exc& \rd\enspace\wri\enspace\exc \\
\bottomrule
\end{tabular}
\smallskip
\begin{tablenotes}[flushleft, online]\small
\item[\dir\rlap{:}] Is a directory.
\item[\syl: ] Is a symbolic link.
\item[\rd: ] Can Read,\, Read files.
\item[\wri: ] $\!\!$Can Write,\, Create files.
\item[\exc: ] Can Execute,\, List files.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}