LaTex学习教程——简单表格(三行线、普通表格)

xiaoxiao2021-02-28  49

普通表格

\begin{table}[h] % [h]表格在文中放置的位置 \centering %作用是使表格居中 \begin{spacing}{1.35} %调整表格行距 \caption{National vulnerability classification} %表格标题 \label{table5} %表格标签 方便引用 \resizebox{0.5\hsize}{!}{ % 缩小整体表格 需要导包 \begin{tabular}{|c|c|} % c 表示表格中的文字居中 \hline \textbf{index} & \textbf{ Class} \\ \texbf 表示加粗 \hline 0 & Steady \\ \hline 1 & Fragile \\ \hline 2 & Very fragile \\ \hline \end{tabular} } \end{spacing} \end{table}

三行线表格

\begin{center} \begin{spacing}{1.1} %longtable的意思是 这个表格可以跨页 \begin{longtable}{p{.1\textwidth}p{.7\textwidth}m{.3\textwidth}} \caption{description} \label{table1} \toprule %第一行线 %表示第一列占1.5cm 第二列占6cm 第三列占2cm 的距离 并且这几个字都是居中对齐 \multicolumn{1}{m{1.5cm}}{\centering Symbol} & \multicolumn{1}{m{6cm}}{\centering Definition} & \multicolumn{1}{m{2cm}}{ Unit} \\ \midrule %第二行线 $V$ & index & -- \\ $X$ & The & -- \\ $Y$ & The & -- \\ $Z$ & The & -- \\ \bottomrule %第三行线 \end{longtable} \end{spacing} \end{center}

转载请注明原文地址: https://www.6miu.com/read-2624115.html

最新回复(0)