LaTeX Insert Table

Insert a table of basic grammar

1. Description

  1. Environment: \ begin {tabular} \ end {tabular}
  2. Align format: l r aligned left center c
  3. Line: | vertical \ hline horizontal double pipe || \ hline \ hline double dash
  4. Set Width: p {} width value, when the content exceeds the width, wrap

2. Source Code

%导言区
\documentclass[UTF8]{ctexart}


%正文区
\begin{document}
	% l 左 c 居中 r 对齐
	% | 竖线 \hline横线 || 双竖线 \hline \hline 双横线
	\begin{tabular}{| l | c | c | c || r |}
		\hline
		名字 & 语文 & 数学 & 英语 & 备注\\
		\hline
		张三啊啊 & 87 & 100 & 93 & 优秀 \\
		\hline
		李 & 75 & 64 & 52 & 补考另行通知\\
		\hline
		\hline
		王五 & 80 & 82 & 78 & 良好\\
		\hline
	\end{tabular}
	
	.
	
	..............................
	
	.
	
	% p{设置宽度},内容超过宽度时,自动换行
	\begin{tabular}{| l | c | c | c || p{1.5cm} |}
		\hline
		名字 & 语文 & 数学 & 英语 & 备注\\
		\hline
		张三 & 87 & 100 & 93 & 优秀 \\
		\hline
		李四 & 75 & 64 & 52 & 补考另行通知\\
		\hline
		\hline
		王五 & 80 & 82 & 78 & 良好\\
		\hline
	\end{tabular}
	
\end{document}

3. The output effect

 

 

To get more specific, you can use the following methods to view the document:

At the command line, type:

  1. texdoc booktab
  2. texdoc longtab
  3. texdoc tabular



 

Published 118 original articles · won praise 63 · views 40000 +

Guess you like

Origin blog.csdn.net/qq_42185999/article/details/104233529