双列文档中的表格宽度问题

双列文档中的表格宽度问题

列文档。我试图插入一个表格,但我的表格超出了页面,而我看到的只是整个表格的一半。代码如下。我该如何解决这个问题?

\begin{table*}[!htbp]
\centering
\arrayrulecolor[rgb]{0.212,0.373,0.569}
\begin{tabular}{|l|l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l!{\color[rgb]{0.31,0.506,0.741}\vrule}l|} 
\hline
\multicolumn{1}{|c|}{\multirow{3}{*}{\textbf{ Works }}}                                                    & \multicolumn{12}{c|}{\textbf{ Duration of Project }}                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \\ 
\cline{2-13}
\multicolumn{1}{|c|}{}                                                                                     & \multicolumn{6}{c!{\color[rgb]{0.31,0.506,0.741}\vrule}}{\textbf{ 1st Year (Months) }}                                                                                                                                                                                         & \multicolumn{6}{c|}{\textbf{ 2nd Year (Months) }}                                                                                                                                                                                              \\ 
\cline{2-13}
\multicolumn{1}{|c|}{}                                                                                     & \multicolumn{1}{c!{\color[rgb]{0.31,0.506,0.741}\vrule}}{\textbf{ 2 }} & \textbf{ 4 }                          & \textbf{ 6 }                          & \textbf{ 8 }                          & \textbf{ 10 }                         & \textbf{ 12 }                         & \textbf{ 2 }                          & \textbf{ 4 }                          & \textbf{ 6  }                         & \textbf{ 8  }                         & \textbf{ 10 }                         & \textbf{ 12 }                          \\ 
\hline
Literature survey,
  purchase of chemicals                                                                 & ~                                                                      & {\cellcolor[rgb]{0.776,0.851,0.945}}~ & {\cellcolor[rgb]{0.776,0.851,0.945}}~ & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                      \\ 
\hhline{|------------>{\arrayrulecolor[rgb]{0.329,0.553,0.831}}->{\arrayrulecolor[rgb]{0.212,0.373,0.569}}|}
Synthesis
  and calcination of BaFe0.9-xNbxO3-δ
  (x: 0, 0.05 and 0.1) perovskite powders.                 & ~                                                                      & ~
  ~                                 & ~                                     & {\cellcolor[rgb]{0.722,0.8,0.894}}~   & {\cellcolor[rgb]{0.722,0.8,0.894}}~   & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                      \\ 
\hline
Characterizations of BaFe0.9-xNbxO3-δ
  (x: 0, 0.05 and 0.1) perovskite powders.                           & ~                                                                      & \multicolumn{1}{l|}{~}                & \multicolumn{1}{l|}{~}                & ~                                     & ~                                     & {\cellcolor[rgb]{0.584,0.702,0.843}}~ & {\cellcolor[rgb]{0.584,0.702,0.843}}~ & ~                                     & ~                                     & ~                                     & ~                                     & ~                                      \\ 
\hline
Fabrication and densification of bulk BaFe0.9-xNbxO3-δ (x: 0, 0.05 and 0.1) samples                        & ~                                                                      & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & {\cellcolor[rgb]{0.329,0.553,0.831}}~ & {\cellcolor[rgb]{0.329,0.553,0.831}}~ & ~                                     & ~                                     & ~                                      \\ 
\hline
Density
  and microstructural studies of BaFe0.9-xNbxO3-δ
  (x: 0, 0.05 and 0.1) bulk samples              & ~                                                                      & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & {\cellcolor[rgb]{0.212,0.373,0.569}}~ & {\cellcolor[rgb]{0.212,0.373,0.569}}~ & ~                                     & ~                                      \\ 
\hhline{|~------------|}
Stress-strain curves and ferro elastic hysteresis loops studies using
  cyclic uniaxial compression tests. & ~                                                                      & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & ~                                     & {\cellcolor[rgb]{0.141,0.251,0.38}}~  & {\cellcolor[rgb]{0.141,0.251,0.38}}~   \\ 
\hline
Publications of the
  analyzed results                                                                     & ~                                                                      & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~ & {\cellcolor[rgb]{0.086,0.149,0.227}}~  \\
\hline
\end{tabular}
\arrayrulecolor{black}
\end{table*}

答案1

一些意见和建议:

  • 使用tabularx环境而不是环境,并且对第一列tabular使用列类型(的修改形式) 。X

  • 去掉所有~(“绑定”)间隔符;这样,11 个数据列占用的空间就少了很多,这意味着第一列有更多的可用空间。

  • \cellcolor将所有指令都包裹在额外的花括号中似乎没有任何用处。

  • 这些\multicolumn{1}{|c|}{}指令没有做任何有用的事情。

  • 您可以加载该mhchem包并使用其\ce宏来排版表达式BaFe_{0.9-x}Nb_{x}O_{3-δ}

在此处输入图片描述

\documentclass[11pt,twocolumn]{article}
\usepackage[table]{xcolor}
\usepackage{hhline}

%% new stuff:
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X}
\usepackage{upgreek,amsmath,newunicodechar}
\newunicodechar{δ}{\ensuremath{\updelta}}
\usepackage{mhchem} % for '\ce' macro
\newcommand\BFNO{\ce{BaFe_{0.9-x}Nb_{x}O_{3-δ}}} % handy shortcut macro

\begin{document}
\begin{table*} % make table span both columns
\arrayrulecolor[rgb]{0.212,0.373,0.569}
\setlength\extrarowheight{2pt} % <-- for a more open "look"
\begin{tabularx}{\textwidth}{| L *{12}{!{\color[rgb]{0.31,0.506,0.741}\vrule}c} |} 
%% Table header:
\hline
\textbf{Works} & 
\multicolumn{12}{c|}{\textbf{Duration of Project, in Months}} \\ 
\cline{2-13}
 & 
\multicolumn{6}{c!{\color[rgb]{0.31,0.506,0.741}\vrule}}{\textbf{1st Year}} & 
\multicolumn{6}{c|}{\textbf{2nd Year}} \\ 
\cline{2-13}
 & 
\multicolumn{1}{c!{\color[rgb]{0.31,0.506,0.741}\vrule}}{\textbf{2}} 
& \textbf{4} & \textbf{6} & \textbf{8} & \textbf{10} & \textbf{12} 
& \textbf{2} & \textbf{4} & \textbf{6} & \textbf{8} & \textbf{10} & \textbf{12} \\ 
\hline

%% Body of Table:
Literature survey, purchase of chemicals 
& & \cellcolor[rgb]{0.776,0.851,0.945}
  & \cellcolor[rgb]{0.776,0.851,0.945}
  & & & & & & & & &  \\ 
\hhline{|-----------%
    ->{\arrayrulecolor[rgb]{0.329,0.553,0.831}}%
    ->{\arrayrulecolor[rgb]{0.212,0.373,0.569}}|}
Synthesis and calcination of \BFNO{} 
($x$: 0, 0.05 and 0.1) perovskite powders. 
& & 
& & \cellcolor[rgb]{0.722,0.8,0.894}
  & \cellcolor[rgb]{0.722,0.8,0.894}
  & & & & & & &  \\ 
\hline
Characterizations of \BFNO{} 
($x$: 0, 0.05 and 0.1) perovskite powders.  
  & & \multicolumn{1}{l|}{} 
    & \multicolumn{1}{l|}{} & & 
    & \cellcolor[rgb]{0.584,0.702,0.843}
    & \cellcolor[rgb]{0.584,0.702,0.843}
    & & & & &  \\ 
\hline
Fabrication and densification of bulk \BFNO{} 
($x$: 0, 0.05 and 0.1) samples 
& & & & & & & 
  & \cellcolor[rgb]{0.329,0.553,0.831}
  & \cellcolor[rgb]{0.329,0.553,0.831}
  & & &  \\ 
\hline
Density and microstructural studies of \BFNO{} 
($x$: 0, 0.05 and 0.1) bulk samples 
& & & & & & & & 
  & \cellcolor[rgb]{0.212,0.373,0.569} 
  & \cellcolor[rgb]{0.212,0.373,0.569} 
  & &  \\ 
\hline
Stress-strain curves and ferro elastic hysteresis loops 
studies using cyclic uniaxial compression tests. 
& & & & & & & & & & 
  & \cellcolor[rgb]{0.141,0.251,0.38}  
  & \cellcolor[rgb]{0.141,0.251,0.38}   \\ 
\hline
Publications of the analyzed results 
& & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227} 
  & \cellcolor[rgb]{0.086,0.149,0.227}  \\
\hline
\end{tabularx}
\end{table*}
\end{document}

答案2

这是我略有不同的建议,同样基于tabularx

除了使用tabularxX类型列作为第一列以确保表格适合可用的文本宽度之外,我wc{...}还对月份列使用了 类型列。这使它们的宽度相同。我还将颜色定义移到了序言中,并确保所有行都使用相同的颜色。除此之外,我还删除了 命令,multirow因为您可以垂直居中三行“Works”条目,即使不使用\multirow。对于列标题,我使用了包\thead中的makecell。如果您后来决定不想将所有标题都加粗,只需\renewcommand\theadfont根据需要进行调整即可。我还删除了多余的\multicolumn命令 和{},以及所有~。最后,我还引入了chemmacros的组合来upgreek改进分子式,并\hhline用 替换了命令\hline

在此处输入图片描述

\documentclass[11pt,twocolumn]{article}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand\theadfont{\normalsize\bfseries}
\usepackage{upgreek}
\usepackage{chemmacros}

\definecolor{myblue1}{rgb}{0.776,0.851,0.945}
\definecolor{myblue2}{rgb}{0.722,0.8,0.894}
\definecolor{myblue3}{rgb}{0.584,0.702,0.843}
\definecolor{myblue4}{rgb}{0.329,0.553,0.831}
\definecolor{myblue5}{rgb}{0.212,0.373,0.569}
\definecolor{myblue6}{rgb}{0.141,0.251,0.38}
\definecolor{myblue7}{rgb}{0.086,0.149,0.227}
\begin{document}

\begin{table*}
\arrayrulecolor[rgb]{0.212,0.373,0.569}
\begin{tabularx}{\textwidth}{|>{\raggedright\arraybackslash}X|*{12}{wc{1em}|}} 
\hline
 & \multicolumn{12}{c|}{\thead{Duration of Project}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \\ 
\cline{2-13}
\thead{Works} & \multicolumn{6}{c|}{\thead{1st Year (Months)}}  & \multicolumn{6}{c|}{\thead{2nd Year (Months)}}                                                                                                                                                                                              \\ 
\cline{2-13}
 & \thead{2} & \thead{4}   & \thead{6}  & \thead{8}  & \thead{10}  & \thead{12}
 & \thead{2} & \thead{4}   & \thead{6}  & \thead{8}  & \thead{10}  & \thead{12} \\ 
\hline
Literature survey,  purchase of chemicals
  &  & \cellcolor{myblue1} & \cellcolor{myblue1} & &  &  &  &  &  &  & &   \\ 
\hline
Synthesis and calcination of \ch{BaFe_{0.9-x}Nb_{x}O_{3-\chemdelta}}(x: 0, 0.05 and 0.1) perovskite powders.
  &  &  &  & \cellcolor{myblue2}   & \cellcolor{myblue2}   &  &  &  &  &  &  &   \\ 
\hline
Characterizations of \ch{BaFe_{0.9-x}Nb_{x}O_{3-\chemdelta}} (x: 0, 0.05 and 0.1) perovskite powders.
  &  &  &  &  &  & \cellcolor{myblue3} & \cellcolor{myblue3} &  &  &  &  &   \\ 
\hline
Fabrication and densification of bulk \ch{BaFe_{0.9-x}Nb_{x}O_{3-\chemdelta}} (x: 0, 0.05 and 0.1) samples
  &  &  &  &  &  &  &  & \cellcolor{myblue4} & \cellcolor{myblue4} &  &  &   \\ 
\hline
Density and microstructural studies of \ch{BaFe_{0.9-x}Nb_{x}O_{3-\chemdelta}} (x: 0, 0.05 and 0.1) bulk samples
  &  &  &  &  &  &  &  &  & \cellcolor{myblue5} & \cellcolor{myblue5} &  &   \\ 
\hline
Stress-strain curves and ferro elastic hysteresis loops studies using  cyclic uniaxial compression tests. 
  &  &  &  &  &  &  &  &  &  &  & \cellcolor{myblue6} & \cellcolor{myblue6}    \\ 
\hline
Publications of the analyzed results 
  &  
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
  & \cellcolor{myblue7}
\\
\hline
\end{tabularx}
\arrayrulecolor{black}
\end{table*}

\end{document}

答案3

不要对table*环境使用任何定位建议。因此

\begin{table*}

不是

\begin{table*}[!htbp]

相关内容