latex表格行号自动递增测试笔记

CentOS 7
texlive 2015

\documentclass{report}
\usepackage[slantfont,boldfont]{xeCJK}
\usepackage[bf,small,center,indentafter,pagestyles]{titlesec} 
\titleformat*{\section}{\centering} 
\usepackage{array}
\usepackage{lettrine}
\newcounter{rowno}
\setcounter{rowno}{0}
\usepackage{geometry} 
\begin{document}
    \section*{\huge{\S{\LaTeX{}表格行号自动递增\lettrine{测试}-{笔记}}}}
    \section*{}
    \begin{center}
      \begin{tabular}{|>{\stepcounter{rowno}\therowno} l|l|l|l|l|l|l|l|}
        \hline \multicolumn{1}{|c|}{序号}&某列 & 某列 & 某列 & 某列 & 某列 & 某列&某列 \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000&  &  &  &  &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 &  &  &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 &  &  &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 &  &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 & 0 &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 & 0 &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 & 0 &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 & 0 &  & \\
        \hline \rule[-2ex]{0pt}{5.5ex} &000 & 000 & 000 & 0 &  &  & \\
        \hline 
    \end{tabular} 
  \end{center}
\newpagestyle{yang}{     
    \sethead{tex}{排版}{tex}     
    \setfoot{tex}{排版}{tex}
    \headrule\footrule} 
\pagestyle{yang} 
    \section*{}
    %注:本文档使用XeTeX。
    \number\year\number\month\number\day\end{document}

显示表格:
latex表格行号自动递增测试笔记_第1张图片

booktabs

texlive 2016

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{table}[h!]
  \centering
  \caption{Caption for the table.}
  \label{tab:table1}
  \begin{tabular}{ccc}
    \toprule
    Some & actual & content\\
    \midrule
    prettifies & the & content\\
    as & well & as\\
    using & the & booktabs package\\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

latex表格行号自动递增测试笔记_第2张图片

你可能感兴趣的:(LaTex)