我需要创建一个4列2行的表。
有什么帮助吗?
我试过这段代码,但它不适合所有的单词
\begin{table}[tbh]
\centering{\scriptsize
\begin{tabular}{p{0.2\textwidth}p{0.2\textwidth}p{0.2\textwidth}p{0.4\textwidth}}
\toprule
\textbf{Name}& \centering\textbf{Description} &\centering\textbf{Type of data}&\centering\textbf{Source}
Continuum Geologico della Regione Toscana & Geologic database of Tuscany Region. Scale 1:10000 & Vector data Esri Shapefile& Tuscany Region Council http://www.regione.toscana.it/-/banche-dati-cartografiageologica\\ \hline
DEM& Digital elevation model. Cell size 10 meters& Raster float & Tuscany Region Council http://www.regione.toscana.it/ \\ \hline
\bottomrule
\end{tabular}
\end{table}有什么帮助吗?
发布于 2019-08-28 14:41:05
geometry包,使页边距稍微小一点。\centering{...}是错误的,它是一个开关,不带参数。删除{}hyperref或url包的url宏。为了在表中启用更多的换行功能,我还推荐使用xurl包。\\,如果您已经使用了booktabs,那么就没有理由继续使用\hline了。使用\midrule会给你更好的间距。\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{xurl}
\usepackage{hyperref}
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\begin{document}
\begin{table}[tbh]
\centering
\scriptsize
\begin{tabular}{@{}P{0.18\textwidth}P{0.20\textwidth}P{0.12\textwidth}P{0.4\textwidth}@{}}
\toprule
\textbf{Name} &
\textbf{Description} &
\textbf{Type of data}&
\textbf{Source}\\
\midrule
Continuum Geologico della Regione Toscana &
Geologic database of Tuscany Region. Scale 1:10000 &
Vector data Esri Shapefile&
Tuscany Region Council \url{http://www.regione.toscana.it/-/banche-dati-cartografiageologica}\\
\addlinespace
DEM&
Digital elevation model. Cell size 10 meters&
Raster float &
Tuscany Region Council \url{http://www.regione.toscana.it/} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

https://stackoverflow.com/questions/57693181
复制相似问题