테이블 헤더를 설명하는 화살표

테이블 헤더를 설명하는 화살표

~ 안에이것StackOverflow 응답은 아래 다이어그램을 볼 수 있습니다.

도표

Tikz에서 이 작업을 수행하는 방법을 알고 싶습니다. 나는 상자가 없고 헤더 바로 아래 값을 가리키는 화살표가 있는 것을 선호하지만 이는 작업할 내용이 있는 경우 관리할 수 있는 세부 사항입니다.

답변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나는 색상과 결합된 것만 을 사용하여 완전히 다른 레이아웃을 제안합니다 threeparttable. 제 생각에는 화살표처럼 표현력이 풍부합니다.

\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} 

여기에 이미지 설명을 입력하세요

관련 정보