1

I have a table like this:

enter image description here

and I would like to have something like: enter image description here

or

enter image description here

It's possible to do this with my table code?

\begin{center}
    \setlength{\tabcolsep}{7pt}
    \renewcommand{\arraystretch}{1.5}
    \begin{table}
        \begin{tabular}{| p{.20\textwidth} | p{.70\textwidth} | }
        \hline
        \textbf{Priority} & \textbf{To-do} \\ \hline
        \textbf{Very high} & \textbf{Requirements}\\ \hline
        & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
        & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
        & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
        \end{tabular}\\
    \caption{To-do-list}
    \end{table}
    \end{center}

Full code

\documentclass{llncs}
\setlength{\intextsep}{12pt plus 0pt} %%Per spazio dopo Caption
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% package sillabazione italiana e uso lettere accentate
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{url}
\usepackage{xspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{manifest}
\makeatother
\usepackage{enumitem} %%per elenchi puntati
\usepackage{fancyhdr} %%per numero di pagina
\usepackage{color}

%%%%%%%
 \newif\ifpdf
 \ifx\pdfoutput\undefined
 \pdffalse % we are not running PDFLaTeX
 \else
 \pdfoutput=1 % we are running PDFLaTeX
 \pdftrue
 \fi
%%%%%%%
 \ifpdf
 \usepackage[pdftex]{graphicx}
 \graphicspath{ {img/} } 
 \else
 \usepackage{graphicx}
 \graphicspath{ {img/} } 
 \fi
%%%%%%%%%%%%%%%
 \ifpdf
 \DeclareGraphicsExtensions{.pdf, .jpg, .tif}
 \else
 \DeclareGraphicsExtensions{.eps, .jpg}
 \fi
%%%%%%%%%%%%%%%

\newcommand{\java}{\textsf{Java}}
\newcommand{\contact}{\emph{Contact}}
\newcommand{\corecl}{\texttt{corecl}}
\newcommand{\medcl}{\texttt{medcl}}
\newcommand{\msgcl}{\texttt{msgcl}}
\newcommand{\android}{\texttt{Android}}
\newcommand{\dsl}{\texttt{DSL}}
\newcommand{\jazz}{\texttt{Jazz}}
\newcommand{\rtc}{\texttt{RTC}}
\newcommand{\ide}{\texttt{Contact-ide}}
\newcommand{\xtext}{\texttt{XText}}
\newcommand{\xpand}{\texttt{Xpand}}
\newcommand{\xtend}{\texttt{Xtend}}
\newcommand{\pojo}{\texttt{POJO}}
\newcommand{\junit}{\texttt{JUnit}}

\newcommand{\action}[1]{\texttt{#1}\xspace}
\newcommand{\code}[1]{{\small{\texttt{#1}}}\xspace}
\newcommand{\codescript}[1]{{\scriptsize{\texttt{#1}}}\xspace}

% Cross-referencing
\newcommand{\labelsec}[1]{\label{sec:#1}}
\newcommand{\xs}[1]{\sectionname~\ref{sec:#1}}
\newcommand{\xsp}[1]{\sectionname~\ref{sec:#1} \onpagename~\pageref{sec:#1}}
\newcommand{\labelssec}[1]{\label{ssec:#1}}
\newcommand{\xss}[1]{\subsectionname~\ref{ssec:#1}}
\newcommand{\xssp}[1]{\subsectionname~\ref{ssec:#1} \onpagename~\pageref{ssec:#1}}
\newcommand{\labelsssec}[1]{\label{sssec:#1}}
\newcommand{\xsss}[1]{\subsectionname~\ref{sssec:#1}}
\newcommand{\xsssp}[1]{\subsectionname~\ref{sssec:#1} \onpagename~\pageref{sssec:#1}}
\newcommand{\labelfig}[1]{\label{fig:#1}}
\newcommand{\xf}[1]{\figurename~\ref{fig:#1}}
\newcommand{\xfp}[1]{\figurename~\ref{fig:#1} \onpagename~\pageref{fig:#1}}
\newcommand{\labeltab}[1]{\label{tab:#1}}
\newcommand{\xt}[1]{\tablename~\ref{tab:#1}}
\newcommand{\xtp}[1]{\tablename~\ref{tab:#1} \onpagename~\pageref{tab:#1}}
% Category Names
\newcommand{\sectionname}{Section}
\newcommand{\subsectionname}{Subsection}
\newcommand{\sectionsname}{Sections}
\newcommand{\subsectionsname}{Subsections}
\newcommand{\secname}{\sectionname}
\newcommand{\ssecname}{\subsectionname}
\newcommand{\secsname}{\sectionsname}
\newcommand{\ssecsname}{\subsectionsname}
\newcommand{\onpagename}{on page}

\newcommand{\xauthA}{Nicola Casadei}
\newcommand{\xauthB}{Marco Benedetti}
\newcommand{\xauthC}{Erica Marchi}
\newcommand{\xauthD}{Mattia Ricci}
\newcommand{\xfaculty}{II Faculty Engineering and Informatic Science}
\newcommand{\xunibo}{Alma Mater Studiorum -- University of Bologna}
\newcommand{\xaddrCE}{via Sacchi 3}
\newcommand{\xcityCE}{47023 Cesena, Italy}

%%% \newcommand{\todo}[1]{\bf{TODO:}\emph{#1}}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\usepackage{xpatch}

\makeatletter
\xpatchcmd{\maketitle}{%
  \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}%
  \addcontentsline{toc}{author}{\toc@uthor}%
}{% Replace by 'nothing'
}{\typeout{success}}{\typeout{failed}}

\xpatchcmd{\maketitle}{%
  \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
  \addcontentsline{toc}{title}{\the\toctitle}\fi
}{%
  % Replace by nothing
}{\typeout{Success}}{\typeout{Failed patching!}}
\makeatother

\begin{document}

\maketitle

%% \begin{abstract}
%% \footnotesize
%%This a Latex template to be used for the reports of Software Engineering.
%%\keywords{Software engineering, managed software development, reports, ....}
%%\end{abstract}

%%% \sloppy

%===========================================================================
\newpage
\setcounter{page}{1}
\section{Intro}
\labelsec{Intro}

\begin{center}
\setlength{\tabcolsep}{7pt}
\renewcommand{\arraystretch}{1.5}
\begin{table}
    \begin{tabular}{| p{.20\textwidth} | p{.70\textwidth} | }
    \hline
    \textbf{Priority} & \textbf{To-do} \\ \hline
    \textbf{Very high} & \textbf{Requirements}\\ \hline
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
    \end{tabular}\\
\caption{To-do-list}
\end{table}
\end{center}

\end{document}

Thank you so much!

  • 6
    Replace \hline with \cline{2-2} for the relevant cases – user31729 Feb 1 '17 at 14:33
  • 2
    You can (and should) replace all these lines \newif\ifpdf \ifx\pdfoutput\undefined \pdffalse % we are not running PDFLaTeX \else \pdfoutput=1 % we are running PDFLaTeX \pdftrue \fi %%%%%%% \ifpdf \usepackage[pdftex]{graphicx} \graphicspath{ {img/} } \else \usepackage{graphicx} \graphicspath{ {img/} } \fi %%%%%%%%%%%%%%% \ifpdf \DeclareGraphicsExtensions{.pdf, .jpg, .tif} \else \DeclareGraphicsExtensions{.eps, .jpg} \fi %%%%%%%%%%%%%%% by a single \usepackage{graphicx}\graphicspath{ {img/} } – David Carlisle Feb 1 '17 at 15:03
  • 3
    I'm voting to close this question as off-topic because it was solved in the comments. – TeXnician Apr 16 '17 at 13:27
  • 2
    @ChristianHupfer -- can you please provide an answer, just for the record. (see What is the etiquette for providing an answer already in the comments? for my motivation.) – barbara beeton Apr 16 '17 at 13:57
  • @barbarabeeton: Apparently, I am too late – user31729 Apr 16 '17 at 16:28
2

Sounds like a job for the multirow package:

\documentclass{article}

\usepackage{multirow}

\begin{document}

\begin{table}
    \centering
  \setlength{\tabcolsep}{7pt}
  \renewcommand{\arraystretch}{1.5}
  \begin{tabular}{| p{.20\textwidth} | p{.70\textwidth} | }
    \hline
    \textbf{Priority} & \textbf{To-do} \\ \hline
    \multirow{4}{*}{\textbf{Very high}} & \textbf{Requirements}\\ \cline{2-2}
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \cline{2-2}
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \cline{2-2}
    & xxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\ \hline
  \end{tabular}
    \caption{To-do-list}
\end{table}

\end{document}

enter image description here

[I replaced \begin{center}...\end{center} by \centering as the former adds additional spacing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.