需要在多个页面内创建长表。我的代码给出了 3 个错误“错误:包数组错误:非法前缀标记 (\renewcommand):使用了 `c'。”和“错误:放错了 \noalign。”和“错误:放错了 \omit。”我的代码是,
\documentclass[12pt,a4paper,oneside]{report}
\usepackage{placeins}
\usepackage{longtable}
\usepackage[fleqn]{amsmath}
\usepackage{booktabs}
\usepackage{tabularx}
\begin{document}
\FloatBarrier
\begin{longtable}[!ht]
\renewcommand{\arraystretch}{1}
\caption[Test Cases for Login Subsystem]{Test Cases for Login Subsystem}
\label{Test Cases for Login Subsystem}\centering
\begin{tabularx}{\textwidth}{|X|X|X|X|}
\toprule
\bfseries Test Objective/Scenario & \bfseries Function & \bfseries Input & \bfseries Expected Outcome\\ \midrule
Login & Login function & Insert dfdgfd ffgfgfgdfg \& dfgdfgdf fdgfg gf gfgfg fdgdfgdfgdfgf \\ \midrule
...........................
vvv & vvv & Insert correct user name \& gdfgfdg gfgfdgfgfgdfgdf fgfgfgd dfgfdgfg \\\bottomrule
\end{tabularx}
\end{longtable}
\FloatBarrier
\FloatBarrier
\begin{longtable}[!ht]
\renewcommand{\arraystretch}{1}
\caption[Test Cases for Admin Subsystem]{Test Cases for Admin Subsystem}
\label{Test Cases for Admin Subsystem}\centering
\begin{tabularx}{\textwidth}{|X|X|X|X|}
\toprule
\bfseries Test Objective/Scenario & \bfseries Function & \bfseries Input & \bfseries Expected Outcome\\ \midrule
Create users & Create a new user & Fill the text fields in user interface & Adding the user to database \\ \midrule
.....................
Manage info.from re-insurance \& legal dept. & Edit dept.info., functions & Edit the text fields & Editing the database \\\bottomrule
\end{tabularx}
\end{longtable}
\FloatBarrier
\end{document}
答案1
longtable
和tabularx
不能以这种方式混合使用。您应该在环境中使用tabularx
或。longtable
Table
但是,如果您想混合使用这两种属性,请尝试tabu
类似的包或更旧的包ltablex
。