테이블을 줄인 후 어떻게 중앙에 놓을 수 있나요?

테이블을 줄인 후 어떻게 중앙에 놓을 수 있나요?

나는 (비머 같은 메트로폴리스 테마) 간단한 테이블을 만들고 뭔가 큰 것이 표시된 다음 이를 줄이는 방법을 살펴보고 다음을 사용했습니다.

\begin{table}[H]
\resizebox{0.8\textwidth}{!}{\begin{minipage}{\textwidth} 
....
\end{minipage}}
\end{table}

잘 작동하지만 테이블이 중앙 위치가 아니므로 항상 오른쪽으로 더 이동하십시오. 을 사용하여 모든 테이블을 포함하려고 시도했지만 \centering \begin{center} and \begin{flushleft}이동하지 않습니다.

여기 내 테이블이 있습니다:

\begin{flushleft}
\begin{table}[H]
 \resizebox{0.8\textwidth}{!}{\begin{minipage}{\textwidth}
\begin{tabular}{l| l l}
\toprule
\textbf{Parameters} & \textbf{Description of values}  \\
\toprule
$ Prohibited\_times $ & Timeslots prohibited for the event. \\
$ Prohibited\_rooms $ & Rooms prohibited for the event. \\
$ Prohibited\_events\_clash $ & Events you can not clash. \\
$ Count\_students $ & Number of students associated to the event. \\
$ Predecessor $ & Events predecessor to the event. \\
$ Successor $ & Event successor to the events. \\
$ Features $ & Characteristics of the event. \\
\bottomrule
\end{tabular}
\end{minipage}}
\end{table}
\end{flushleft} 
\end{frame}

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

어떤 아이디어가 있나요? 문안 인사

답변1

\centering뒤에 포함하려고 했습니까 \begin{table}[h]?

또한 minipage환경을 제거할 수도 있습니다.

아래 예는 나에게 잘 작동했습니다.

\begin{frame}
    \begin{table}[h]
    \centering
    \resizebox{0.7\textwidth}{!}{
        \begin{tabular}{l l l}
\toprule
\textbf{Parameters} & \textbf{Description of values}  \\
\toprule
$ Prohibited\_times $ & Timeslots prohibited for the event. \\
$ Prohibited\_rooms $ & Rooms prohibited for the event. \\
$ Prohibited\_events\_clash $ & Events you can not clash. \\
$ Count\_students $ & Number of students associated to the event. \\
$ Predecessor $ & Events predecessor to the event. \\
$ Successor $ & Event successor to the events. \\
$ Features $ & Characteristics of the event. \\
\bottomrule
        \end{tabular}
    }
    \end{table}
\end{frame}

답변2

adjustbox로 시도했는데 작동했습니다. 문안 인사.

\begin{table}[h]
\centering
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{l| l l}
\toprule
\textbf{Parameters} & \textbf{Description of values}  \\
\toprule
$ Prohibited\_times $ & Timeslots prohibited for the event. \\
$ Prohibited\_rooms $ & Rooms prohibited for the event. \\
$ Prohibited\_events\_clash $ & Events you can not clash. \\
$ Count\_students $ & Number of students associated to the event. \\
$ Predecessor $ & Events predecessor to the event. \\
$ Successor $ & Event successor to the events. \\
$ Features $ & Characteristics of the event. \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table}
\end{frame}

관련 정보