删除表格环境中的缩进,并将生成的表格居中

删除表格环境中的缩进,并将生成的表格居中

如果我希望表格宽度为“1.5\textwidth”,该如何将其居中?

\documentclass{amsart}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{ctable}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{multirow}
\begin{document}

 \begin{table}[p]
%\centering
 \resizebox{1.5\textwidth}{!}{%
 \noindent\begin{tabular}{llllll}
 \toprule
 \multicolumn{6}{c}{Care Type} \\
 \textbf{Direct care} & \textbf{Housekeeping} & \textbf{Mealtimes} & \textbf{Medication rounds  } & \textbf{Miscellaneous} & \textbf{Personal care} \\
 \midrule
 Blood pressure measurement & Equipment cleaning& Dispensing meals& Distributing medication&Call requests&Toiletting\\
 & &&&&\\
 Weights & Cleaning patient surfaces& &Injections&Bed making &Changing\\
 & &&&&\\
 SATs~\footnote{Blood sugar saturation}  & &&&&\\
  \bottomrule
 \end{tabular}}
 \caption{Activity type and examples of each}
 \label{tab:activities}\end{table}

 \end{document}

看起来像这样:

在此处输入图片描述

编辑:

使用\centerline{\resizebox{\textwidth}{!}{...}我得到:

在此处输入图片描述

使用\centering\makebox{\textwidth}{}我得到: 在此处输入图片描述

使用\begin{tabularx}{1.5\textwidth}{*6X}

\begin{table}[p]
 \centering\makebox[\textwidth]
 % \centerline
  {\resizebox{1.1\textwidth}{!}{%
\begin{tabularx}{1.5\textwidth}{*6X} % \begin{tabularx}{llllll}
 \toprule
 \multicolumn{6}{c}{Care Type} \\
 \textbf{Direct care} & \textbf{Housekeeping} & \textbf{Mealtimes} & \textbf{Medication rounds  } & \textbf{Miscellaneous} & \textbf{Personal care} \\
 \midrule
 Blood pressure measurement & Equipment cleaning& Dispensing meals& Distributing medication&Call requests&Toiletting\\
 & &&&&\\
 Weights & Cleaning patient surfaces& &Injections&Bed making &Changing\\
 & &&&&\\
 SATs~\footnote{Blood sugar saturation}  & &&&&\\
  \bottomrule
 \end{tabularx}}}
\smallskip
 \caption{Activity type and examples of each}
 \label{tab:activities}\end{table}

答案1

\noindent在 LR 框内不执行任何操作。您可以使用,\makebox但更简单的方法可能只是使用纯 TeX 派生\centerline。假设 1.5\textwidth适合纸张……

(代码已修改,以使用注释掉的\makebox原始版本。)\centerline

\documentclass{amsart}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{ctable}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{multirow}
\begin{document}

 \begin{table}[p]
 \centering\makebox[\textwidth]
 % \centerline
 {\resizebox{1.5\textwidth}{!}{%
 \begin{tabular}{llllll}
 \toprule
 \multicolumn{6}{c}{Care Type} \\
 \textbf{Direct care} & \textbf{Housekeeping} & \textbf{Mealtimes} & \textbf{Medication rounds  } & \textbf{Miscellaneous} & \textbf{Personal care} \\
 \midrule
 Blood pressure measurement & Equipment cleaning& Dispensing meals& Distributing medication&Call requests&Toiletting\\
 & &&&&\\
 Weights & Cleaning patient surfaces& &Injections&Bed making &Changing\\
 & &&&&\\
 SATs~\footnote{Blood sugar saturation}  & &&&&\\
  \bottomrule
 \end{tabular}}}
\smallskip
 \caption{Activity type and examples of each}
 \label{tab:activities}\end{table}

 \end{document}

相关内容