我有一张使用tabular
环境的表:
\begin{table}[ht]
\centering
\begin{tabular}{c|cccccc}
& Landmarks in the Human Genome Project \\
\hline
\rowcolor{LightCyan}
1953& Watson-Crick publish DNA structure & & & & & & \\
1975& F.Sanger, A.Maxam and W.Gilbert develop methods for sequencing DNA & & & & & & \\
\rowcolor{LightCyan}
1977& Bacteriophage $\Phi X -174$ sequenced: first complete genome sequenced & & & & & & \\
1980& US Supreme court rules genetically modified bacteria are pantentable & & & & & & \\
\rowcolor{LightCyan}
1981& Human mitochondrial DNA sequenced: $16569$ base pairs & & & & & & \\
1984& Epstein-Barr virus genome sequenced: 172,281 base pairs & & & & & &\\
\rowcolor{LightCyan}
1990& International Human Genome Project launched & & & & & & \\
1991& J. Craig Venter identifies sequences of DNA complementary to messenger RNA & & & & & & \\
\rowcolor{LightCyan}
1992& Complete low resolution linkage map of the human genome & & & & & & \\
1992& \textit{Caenorhabditis} sequencing project begins & & & & & & \\
\rowcolor{LightCyan}
1992& J. Craig Venter forms the Institute for Genome Research (TIGR) & & & & & & \\
1992& Wellcome Trust and UK Medical Research Council establish The Sanger Center for large-scale genomic sequencing & & & & & &\\
\rowcolor{LightCyan}
1995& First complete sequence of bacterial genome, \textit{Haemophilus influenzae} by TIGR & & & & & & \\
1996& High resolution map of human genome & & & & & &\\
\rowcolor{LightCyan}
1996& Completion of yeast genome, first eukaryotic genome sequence & & & & & & \\
1996& Celera claims to finish sequencing human genome by 2001, Wellcome Trust respond by increasing funding to the Sanger Center & & & & & &\\
\rowcolor{LightCyan}
1998& \textit{Caenorhabdtis elegans} genome published & & & & & & \\
\hline
\end{tabular}
\end{table}
运行良好,并出现在文档中我想要的位置,但是当我向表中添加一个或多个项目时,表会出现在文档底部的引用下方。这是为什么?另外,我不确定如何解析这里的乳胶代码来向您显示表格 - 如果有人能告诉我怎么做那就太好了。
答案1
解决浮动“浮动”到纸张背面的问题的最快方法可能是简单地省略h
位置说明符。如果需要,请使用位置[t!]
说明符。
为了很多有关 LaTeX 如何“决定”放置浮动元素的更多信息,请参阅帖子如何影响 LaTeX 中图形和表格等浮动环境的位置?尤其是 Frank Mittelbach 的详尽回答。
关于您的表格的一些补充说明:似乎指定的列数比必要的多得多。事实上,似乎只有两列。虽然如果您指定表格应该有大约 10 列,不会发生任何不好的事情,但指定的列越多,调试任务就会变得更加繁琐。顺便说一句,您可以将文本左对齐,而不是将每列的内容居中。并且,考虑使用环境tabularx
并使用X
第二列的列类型,以便让长条目根据需要换行。
\documentclass{article}
\usepackage[table,svgnames]{xcolor}
\usepackage{tabularx,ragged2e,booktabs}
\begin{document}
\begin{table}
\caption{Landmarks in the Human Genome Project}
\smallskip
\setlength\extrarowheight{1pt}
\begin{tabularx}{\textwidth}{l>{\RaggedRight\arraybackslash}X}
\toprule
\rowcolor{LightCyan}
1953& Watson and Crick publish DNA structure\\
1975& F. Sanger, A. Maxam and W. Gilbert develop methods for sequencing DNA\\
\rowcolor{LightCyan}
1977& Bacteriophage $\Phi$ X-174 sequenced: first complete genome sequenced\\
1980& US Supreme court rules genetically modified bacteria are patentable\\
\rowcolor{LightCyan}
1981& Human mitochondrial DNA sequenced: 16,569 base pairs\\
1984& Epstein-Barr virus genome sequenced: 172,281 base pairs\\
\rowcolor{LightCyan}
1990& International Human Genome Project launched\\
1991& J. Craig Venter identifies sequences of DNA complementary to messenger RNA\\
\rowcolor{LightCyan}
1992& Complete low resolution linkage map of the human genome\\
1992& \textit{Caenorhabditis} sequencing project begins\\
\rowcolor{LightCyan}
1992& J. Craig Venter forms the Institute for Genome Research (TIGR)\\
1992& Wellcome Trust and UK Medical Research Council establish The Sanger Center for large-scale genomic sequencing \\
\rowcolor{LightCyan}
1995& First complete sequence of bacterial genome, \textit{Haemophilus influenzae} by TIGR\\
1996& High resolution map of human genome\\
\rowcolor{LightCyan}
1996& Completion of yeast genome, first eukaryotic genome sequence\\
1996& Celera claims to finish sequencing human genome by 2001, Wellcome Trust respond by increasing funding to the Sanger Center\\
\rowcolor{LightCyan}
1998& \textit{Caenorhabdtis elegans} genome published\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}