Monday, May 27, 2013

Use a nested enumeration as a column of a table

Use a nested enumeration as a column of a table

I am creating a list of requirements in a table in which the first column should be an enumeration, such that each requirement is identified by a unique number. Some requirements also have sub requirements, so I need nested enumeration.
An example:
+-----+-----------------------------+
| ID  |         Requirement         |
+-----+-----------------------------+
| 1   | Requirement a               |
| 2   | Requirement b               |
| 2.1 | Some requirement of b       |
| 2.2 | Some other requirement of b |
| 3   | Another requirement         |
+-----+-----------------------------+
The only solution I could come up with was the following (obviously not working, even without nesting):
\begin{tabularx}{\textwidth}{|X|X|}
\begin{enumerate}
  \hline
  \item & Requirement a \\ \hline
  \item & Requirement b \\ \hline
\end{enumerate}
\end{tabularx}
Since this example without nesting doesn't work, I assume that a similar example with nesting wouldn't work as well. Other approaches for adding enumeration to a tabular which I found on SE such as this one don't extend to nested enumerations as well.
How can I achieve such an enumeration?
How can I achieve such a thing?

No comments:

Post a Comment