\table 환경 내부의 모양 정렬에 관해. 테이블과 둥근 사각형을 중앙에 배치하는 방법은 무엇입니까?

\table 환경 내부의 모양 정렬에 관해. 테이블과 둥근 사각형을 중앙에 배치하는 방법은 무엇입니까?
\documentclass[12pt]{article}
\usepackage{lmodern}
\usepackage{pdflscape}
\usepackage{transparent}
\usepackage{iftex}
\usepackage{graphicx}
\usepackage[table]{xcolor}
\usepackage{makecell}
\usepackage[table]{xcolor}
\usepackage{ragged2e}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage[left = 0.5in, right = 0.5in, top = 0.5in, bottom = 0.5in]{geometry}

\usetikzlibrary{shapes, arrows, positioning}

\begin{document}
\begin{landscape}
\begin{table}
\centering
\scalebox{4}{
\begin{tabular}{|c|c|c|c|c|c|}
\rowcolor[gray]{0.68}\multicolumn{6}{c}{
\begin{tikzpicture}
\node [draw = none, color = white, fill = gray!50, rounded rectangle, xshift = 0cm, yshift= 3cm] {\scriptsize ABCDEF BEDDDD TTTTTTT P}; 
\end{tikzpicture}
\vspace*{0.2cm}}\\
\hline
\rowcolor[gray]{0.97}
1 & 2 & 3 & 4 & 5 & 6\\ 
\hline
\rowcolor[gray]{0.97} 7 & 8 & 9 & 10 & 11 & 12 \\ 
\hline
\rowcolor[gray]{0.97}13 & 14 & 15 & 16 & 17 & 18\\
\hline
\rowcolor[gray]{0.97}19 & 20 & 21 & 22 & 23 & 24 \\ 
\hline
\rowcolor[gray]{0.97}25 & 26 & 27 & 28 & 29 & 30\\ 
\hline
\end{tabular}}
\end{table}
\end{landscape}
\end{document}

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

답변1

tikzpicture센터링을 버리는 가짜 공간이 있습니다 . 해당 공간을 제거하기만 하면 됩니다.

          \begin{tikzpicture}
            \node [color = white, font=\scriptsize, fill = gray!50, rounded rectangle, yshift= 3cm] {ABCDEF BEDDDD TTTTTTT P}; 
          \end{tikzpicture}%

그러나 사용은 \scalebox권장되지 않습니다. 특히 시각적 크기를 제공하는 글꼴을 사용하는 경우 글꼴 크기를 변경하는 것이 좋습니다.

예를 들어,

    \centering
    \LARGE
      \begin{tabular}{|c|c|c|c|c|c|}
        \rowcolor[gray]{0.68}\multicolumn{6}{c}{
          \begin{tikzpicture}
            \node [color = white, font=\small, fill = gray!50, rounded rectangle,align=center, yshift= 3cm] {ABCDEF BEDDDD TTTTTTT P}; 
          \end{tikzpicture}%
          \vspace*{0.2cm}}\\
        \hline
        \rowcolor[gray]{0.97}
        1 & 2 & 3 & 4 & 5 & 6\\ 
        \hline
        \rowcolor[gray]{0.97} 7 & 8 & 9 & 10 & 11 & 12 \\ 
        \hline
        \rowcolor[gray]{0.97}13 & 14 & 15 & 16 & 17 & 18\\
        \hline
        \rowcolor[gray]{0.97}19 & 20 & 21 & 22 & 23 & 24 \\ 
        \hline
        \rowcolor[gray]{0.97}25 & 26 & 27 & 28 & 29 & 30\\ 
        \hline
      \end{tabular}

booktabs전문적인 품질의 표 형식 조판에 대한 지침을 살펴보고 싶을 수도 있지만 이는 표 형식보다 매트릭스에 더 가깝습니다.

관련 정보