調整表格寬度為列寬

調整表格寬度為列寬

我正在嘗試使表格更寬,我已經製作了一個帶有文字寬度的調整框,但沒有任何反應..有人可以幫助我嗎?

我的程式碼:

\begin{table}[htbp]
      \centering
      \caption{Three different Noise Levels}
        \begin{adjustbox}{max width=\textwidth}
        \begin{tabular}{ccc}
        \hline
        \textbf{V output}\textbf{} & &  \textbf{SNR Level} \\
        \hline
        From  & To    &  \\
        \hline
        -inf    & 0     & Low \\
        0     & 20    & Medium \\
        20    & inf    & High \\
        \hline
        \end{tabular}%
        \end{adjustbox}
      \label{tab:addlabel}%
    \end{table}%

輸出: 在此輸入影像描述

答案1

您可以使用tabularx跨越整體\columnwidth而不是tabular

微量元素

\documentclass[twocolumn]{article}

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

\begin{document}

\noindent x\hrulefill x

\begin{table}[htbp]
      \centering
      \caption{Three different Noise Levels}
        \begin{tabularx}{\columnwidth}{YcY}
        \hline
        \textbf{V output}\textbf{} & &  \textbf{SNR Level} \\
        \hline
        From  & To    &  \\
        \hline
        -inf    & 0     & Low \\
        0     & 20    & Medium \\
        20    & inf    & High \\
        \hline
        \end{tabularx}%
      \label{tab:addlabel}%
    \end{table}%

\end{document} 

在此輸入影像描述

相關內容