绘制三线表需要用到\toprule、\midrule、\bottomrule 用到了\usepackage{booktabs}%宏包
普通线条用\hline即可 \documentclass{article}
\usepackage{booktabs}%宏包
\documentclass{article} \usepackage{booktabs}%宏包 \begin{document} \title{Table exercises of LaTex} \author{Yiyi} \maketitle \begin{table}[htbp] \centering \begin{tabular}{ccc} \hline NAME&SEX&AGE\\ \hline A Qin&female&18\\ Xiao Beike&female&18\\ Star&female&18\\ Pig Du&male&28\\ \hline \end{tabular} \caption{My happy life with friends} \end{table} \begin{table}[htbp] \centering \caption{My happy life with friends} \begin{tabular}{lll} \toprule NAME&SEX&AGE\\ \midrule A Qin&female&18\\ Xiao Beike&female&18\\ Star&female&18\\ Pig Du&male&28\\ \bottomrule \end{tabular} \end{table} \end{document}运行结果: