1. 程式人生 > 其它 >Latex學習筆記(五)插入表格

Latex學習筆記(五)插入表格

技術標籤:Latex學習筆記

插入表格示例:

\begin{table}[htbp]
	\centering
	\begin{tabular}{|c|l|l|c|l|l|l|l|l|l|l|l|}
		\hline
		\multicolumn{3}{|c|}{Symbols} & \multicolumn{9}{c|}{Definition}                                                 \\ \hline
		\multicolumn{3}{|c|}{(x,y)}   & \multicolumn{9}{c|}{Player position coordinates}                                \\ \hline
		\multicolumn{3}{|c|}{N}       & \multicolumn{9}{c|}{Total passes}                                               \\ \hline
		\multicolumn{3}{|c|}{$D_{ij}$}     & \multicolumn{9}{c|}{Pass times of two players in the network}                   \\ \hline
		\multicolumn{3}{|c|}{$d_{ij}$}     & \multicolumn{9}{c|}{The average number of passes of two players in the network} \\ \hline
	\end{tabular}
\end{table}

有的時候,表格會換行錯位,有一種方法是在後面加【htbp】
不過經過實測,有時候也不太靈

比較有效的方法是
調入巨集包\usepackage{graphicx}
把【htbp】改成【H】即可

當然表格的輸入推薦一個網址
https://www.tablesgenerator.com/
可以將視覺化的表格轉換成latex語言,真方便~