在Latex中的\textwidth内安装表格

在Latex中的\textwidth内安装表格,latex,Latex,我有一个比文档的\text宽度更宽的表。(我不想更改\text宽度。) 我想通过包装最后一列(最右边的一列)的文本,强制将表格装入\textwidth。 这是我表格的代码: \begin{table*}[!t] \caption{Extracted Features used in Meta-Learning} \label{sample-features} \label{tbl:features} \begin{center} \begin{tabular*}{0.95\textwidth,c

我有一个比文档的\text宽度更宽的表。(我不想更改\text宽度。) 我想通过包装最后一列(最右边的一列)的文本,强制将表格装入\textwidth。 这是我表格的代码:

\begin{table*}[!t]
\caption{Extracted Features used in Meta-Learning} \label{sample-features}
\label{tbl:features}
\begin{center}
\begin{tabular*}{0.95\textwidth,center}{|l||l|}
{\textbf{FEATURE}}  &{\textbf{DESCRIPTION}} \\
\hline \\
n.examples & Number of examples \\
n.attrs & Number of attributes \\
prop.symbolic.attrs & Proportion of symbolic attributes \\
prop.missing.values & Proportion of missing values \\
class.entropy & Class entropy \\
avg.mutual.information & Average mutual information \\
prop.h.outlier & Proportion of continuous attributes with outliers \\
avg.attr.entropy & Average attribute entropy \\
avg.symb.pair.mutual.infor & Average mutual information between pairs of symbolic attributes \\
avg.abs.attr.correlation & Average absolute correlation between continuous attributes \\
avg.skewness & Mean skewness of attributes \\
avg.abs.skewness & Mean absolute skewness of attributes \\
avg.kurtosis & Mean kurtosis of attributes \\
canonical.correlation.best.linear.combination & Canonical correlation of the best linear combination of attributes to distinguish between classes \\
relative.prop.best.linear.combination & Proportion of the total discrimination power explained by the best linear combination \\
\end{tabular*}
\end{center}
\end{table*}
此代码的结果是以下文档:

红线右侧的部分(我自己加的)应该包起来


有什么帮助吗?

这里是答案。我希望它能帮助您:

使用包
表格
,如下所示:

\usepackage{tabularx,booktabs}
.
.
.
\begin{table*}[!t]
\caption{Caption}
\label{tbl:tbl}
\centering
\begin{tabularx}{\textwidth}{X X}
\toprule
Item 1 & Item 2 \\
\midrule
Item 1 description & Item 2 description \\
.
.
.
\bottomrule
\end{tabularx}
\end{table*}
\begin{table*}[!t]
\caption{Extracted Features used in Meta-Learning} \label{sample-features}
\label{tbl:features}
\centering
\begin{tabularx}{0.95\textwidth}{|X||X|}
\toprule
{\textbf{FEATURE}}  &{\textbf{DESCRIPTION}} \\
\midrule
n.examples & Number of examples \\
n.attrs & Number of attributes \\
prop.symbolic.attrs & Proportion of symbolic attributes \\
prop.missing.values & Proportion of missing values \\
class.entropy & Class entropy \\
avg.mutual.information & Average mutual information \\
prop.h.outlier & Proportion of continuous attributes with outliers \\
avg.attr.entropy & Average attribute entropy \\
avg.symb.pair.mutual.infor & Average mutual information between pairs of symbolic attributes \\
avg.abs.attr.correlation & Average absolute correlation between continuous attributes \\
avg.skewness & Mean skewness of attributes \\
avg.abs.skewness & Mean absolute skewness of attributes \\
avg.kurtosis & Mean kurtosis of attributes \\
canonical.correlation.best.linear.combination & Canonical correlation of the best linear combination of attributes to distinguish between classes \\
relative.prop.best.linear.combination & Proportion of the total discrimination power explained by the best linear combination \\
\bottomrule
\end{tabularx}
\end{table*}
在我的情况下,解决方案如下:

\usepackage{tabularx,booktabs}
.
.
.
\begin{table*}[!t]
\caption{Caption}
\label{tbl:tbl}
\centering
\begin{tabularx}{\textwidth}{X X}
\toprule
Item 1 & Item 2 \\
\midrule
Item 1 description & Item 2 description \\
.
.
.
\bottomrule
\end{tabularx}
\end{table*}
\begin{table*}[!t]
\caption{Extracted Features used in Meta-Learning} \label{sample-features}
\label{tbl:features}
\centering
\begin{tabularx}{0.95\textwidth}{|X||X|}
\toprule
{\textbf{FEATURE}}  &{\textbf{DESCRIPTION}} \\
\midrule
n.examples & Number of examples \\
n.attrs & Number of attributes \\
prop.symbolic.attrs & Proportion of symbolic attributes \\
prop.missing.values & Proportion of missing values \\
class.entropy & Class entropy \\
avg.mutual.information & Average mutual information \\
prop.h.outlier & Proportion of continuous attributes with outliers \\
avg.attr.entropy & Average attribute entropy \\
avg.symb.pair.mutual.infor & Average mutual information between pairs of symbolic attributes \\
avg.abs.attr.correlation & Average absolute correlation between continuous attributes \\
avg.skewness & Mean skewness of attributes \\
avg.abs.skewness & Mean absolute skewness of attributes \\
avg.kurtosis & Mean kurtosis of attributes \\
canonical.correlation.best.linear.combination & Canonical correlation of the best linear combination of attributes to distinguish between classes \\
relative.prop.best.linear.combination & Proportion of the total discrimination power explained by the best linear combination \\
\bottomrule
\end{tabularx}
\end{table*}
你好您是否尝试过一些段落对齐方式,如
lp{.6\textwidth}
而不是
X
?另外: