Forgot password?
 Create new account
View 2528|Reply 0

表格自动编号

[Copy link]

700

Threads

110K

Posts

910K

Credits

Credits
94177
QQ

Show all posts

kuing Posted at 2015-2-2 22:15:45 |Read mode
转自latex-community.org/component/content/article … /500-latex-tricks-ix

Rows in tables

A traditional application of tables is to number every row in it. If you put
\usepackage{array}
in the preamble, and
\newcounter{rowno}
\setcounter{rowno}{0}
\begin{document}
\begin{tabular}{>{\stepcounter{rowno}\therowno.}cl}
\multicolumn{1}{r}{No.} & text \\
\hline
& first \\
& second \\
& third \\
& fourth
\end{tabular}

in the body, the result is the following:

Numbered rows in a table
This might be useful in many situations.

手机版Mobile version|Leisure Math Forum

2025-4-21 01:18 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list