2

Could anyone help me with how to create a table shown in the picture in latex? Thank youenter image description here

  • 2
    welcome to tex.se. Please tell us what in particular about the table you wish to replicate. – Mico Nov 14 '20 at 12:00
  • For the interrupted horizontal lines, you can use \cline(For example as in \cline{1-1} \cline{3-3} \cline{5-6}). For the text "So That", you could use the \multirow command from the multirow package (For example as in \multirow[b]{4}{1.7cm}{AS a \textbf{Manager} I want to}. – leandriis Nov 14 '20 at 12:32
  • 1
    Welcome to TeX.SE. You've tagged this as multirow. Have you looked for examples of that usage? – Teepeemm Nov 14 '20 at 14:59

3 Answers3

2

With {NiceTabular} of nicematrix, it's very easy.

\documentclass{article}
\usepackage{nicematrix}
\NiceMatrixOptions{cell-space-top-limit=2pt}

\begin{document} \begin{NiceTabular}{llp{1in}lp{1in}l|}[hvlines] 0 & Role & Feature & & Goal/Objective & Priority \ US1 & \Block{4-1}{As a \ \textbf{manager},\ I want do} & & \Block{4-1}{so\ that} \ US2 \ US3 \ US4 \ \end{NiceTabular} \end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes).

Output of the above code

F. Pantigny
  • 40,250
1

In a very simple way:

 \renewcommand{\arraystretch}{1.2}% from https://tex.stackexchange.com/questions/7208/how-to-vertically-center-the-text-of-the-cells
 \begin{tabular}{|l|l|p{1in}|l|p{1in}|l|}
    \hline%
    N0  & Role             & Feature &      & Goal/Objective & Priority \\%
    \hline%
    US1 &                  &         &      &                &          \\%
    \cline{1-1}\cline{3-3}\cline{5-6}%
    US2 & AS a             &         & So   &                &          \\%
    \cline{1-1}\cline{3-3}\cline{5-6}%
    US3 & \textbf{Manager} &         & that &                &          \\%
    \cline{1-1}\cline{3-3}\cline{5-6}%
    US4 & I want to        &         &      &                &          \\%
    \hline%
 \end{tabular}

Note that vertical lines in table are not recommended: they are ugly. For horizontal lines you can use \toprule, midrule, or \bottomrule from booktabs.

table verticaly centered

gigiair
  • 1,812
  • Text is not centered vertically within the respective cell, most noticeably in the top row and left column. Is there a fix for that? – Artmancc Nov 14 '20 at 14:25
  • from https://tex.stackexchange.com/questions/7208/how-to-vertically-center-the-text-of-the-cells you can type \renewcommand{\arraystretch}{1.4} before the tabular declaration. – gigiair Nov 14 '20 at 20:35
1

Here is a version using \multirow:

enter image description here

\documentclass{article}
\usepackage{geometry}
\usepackage{multirow}
\begin{document}

\begin{tabular}{|l|p{1.75cm}|p{3cm}|p{0.75cm}|p{4cm}|l|}% \hline% N0 & Role & Feature & & Goal/Objective & Priority \ \hline% US1 & \multirow[b]{4}{=}{AS a \textbf{Manager} I want to} & & \multirow{4}{=}{So that} & & \ \cline{1-1}\cline{3-3}\cline{5-6}% US2 & & & & & \ \cline{1-1}\cline{3-3}\cline{5-6}% US3 & & & & & \ \cline{1-1}\cline{3-3}\cline{5-6}% US4 & & & & & \ \hline% \end{tabular}

\end{document}

leandriis
  • 62,593