表格
一個簡單的表格
\begin{table}
\centering
\caption{text}
\begin{tabular}{|c|c|c|}
\hline
1&2&3\\
\hline
\end{tabular}
\end{table}
效果:
- 表格要放在
table
環境下 \centering
設置表格在文章中居中\caption
設置表格的標題- 表格內容放到
tabular
環境中 {|c|c|c|}
的意思表示表格內容居中,旁邊有豎線,可選參數有c
、l
、r
,分別代表居中,左對齊和右對齊。\hline
給表格添加橫線- 表格一行不同列的內容用
&
分隔
表格太寬
使用\resizebox{\textwidth}{7mm}{}
調整
\resizebox{\textwidth}{7mm}{
\begin{tabular}{cccc}
\end{tabular}
}
調整前
調整後