如何正确调整这个tabularx中的表列参数?

如何正确调整这个tabularx中的表列参数?

我正在尝试调整列参数,但找不到一个好的组合(l/ X/ p{.1\linewidth})。X在图 1 的示例代码中添加它会使列变得非常小,我不明白这一点。因此,我X目前没有它。图 2 中没有输出最后几列的代码X

\documentclass{beamer}

%http://tex.stackexchange.com/a/309253/13173
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathpazo}
\usepackage[warn]{textcomp}

\usepackage{adjustbox}
\usepackage{tabularx}

\begin{document}

\begin{table}
\centering
\resizebox{.5\textheight}{!}{
\begin{tabularx}{\textwidth}{| l |  p{.27\linewidth} |  p{.27\linewidth} |  p{.27\linewidth} | p{.2\linewidth} |} %
\hline 
\textbf{Feature} & \textbf{Cytotoxic edema} 
         & \textbf{Vasogenic edema} 
         & \textbf{Interstitial edema} 
         & \textbf{Osmotic edema} \\ \hline 
Composition & i/c, acc. of water and Na+
        & e/c, ultrafiltrate of plasma
        & CSF
        & V(e/c) $>$ V(i/c) \\ \hline
Location of edema & Gray-white matter 
          & White - -
          & Periventricular white - - 
          & White - - \\ \hline
V(E/c fluid) & \textdownarrow 
         & \textuparrow 
         & \textuparrow 
         & \textuparrow \\ \hline
Etiology       & DM, hypothermia, ... 
           & Tumors, trauma, ...
           & Hydrocephalus 
           & Hemodialysis, hypertensive crisis, ...\\ \hline
Response to therapy & Yes/No (diuretics transiently eff.)
            & Yes (corticosteroids)
            & Yes (diuretics transiently eff.)
            & Yes/No \\ \hline
\end{tabularx}
}
\caption{Types of brain edema.}
\end{table}

\end{document}

图1 不带 的输出X,图2 带 的输出X

在此处输入图片描述 在此处输入图片描述

答案1

我会删除所有垂直线和大多数水平线。我还会将列类型设置为右对齐,而不是完全对齐。最后,不要使用环境table——只需将“标题”放在 的参数中\frametitle。请注意,下面的代码通过设计不雇用\resizebox

在此处输入图片描述

\documentclass{beamer}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usefonttheme{professionalfonts}
\usepackage{mathpazo}
\usepackage[warn]{textcomp}

\usepackage{ragged2e,tabularx,booktabs}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\hyphenation{cortico-steroids diu-ret-ics}
\begin{document}

\begin{frame}
\frametitle{Types of brain edema}

\footnotesize
\setlength\tabcolsep{2pt} % default: 6pt
\begin{tabularx}{\textwidth}{@{}
    >{\hsize=0.86\hsize}Y 
    *{4}{>{\hsize=1.035\hsize}Y} @{}}
\toprule
\textbf{Feature} & \textbf{Cytotoxic edema} 
         & \textbf{Vasogenic edema} 
         & \textbf{Interstitial edema} 
         & \textbf{Osmotic edema} \\ 
\midrule 
Composition & i/c, acc. of water and Na+
        & e/c, ultrafiltrate of plasma
        & CSF
        & V(e/c) > V(i/c) \\ 
\addlinespace
Location of edema & Gray-white matter 
          & White - -
          & Periventricular white - - 
          & White - - \\ 
\addlinespace
V(E/c fluid) & \textdownarrow 
         & \textuparrow 
         & \textuparrow 
         & \textuparrow \\ 
\addlinespace
Etiology       & DM, hypothermia, \dots 
           & Tumors, trauma, \dots
           & Hydrocephalus 
           & Hemodialysis, hypertensive crisis, \dots\\ \addlinespace
Response to therapy & Yes/No (diuretics transiently eff.)
            & Yes (corticosteroids)
            & Yes (diuretics transiently eff.)
            & Yes/No \\
\bottomrule
\end{tabularx}

\end{frame}
\end{document}

答案2

\begin{table}
\resizebox{\textwidth}{!}{%
  \begin{tabularx}{1.5\textwidth}{| l | X | X | X | X |} %
   ....

在此处输入图片描述

相关内容