0

I am trying to migrate my table draft from Word to LaTeX.

Business Model Canvas

The following LaTeX code has problems with the cell alignment of "Revenue Streams".

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[]{multirow}

\begin{document}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
\multirow{2}{*}{Key Partnerships} & Key Activities & \multicolumn{2}{l|}{\multirow{2}{*}{Value Proposition}} & Customer Relationships & \multirow{2}{*}{Customer Segments} \\ \cline{2-2} \cline{5-5}
                                  & Key Resources  & \multicolumn{2}{l|}{}                                   & Channels               &                                    \\ \hline
\multicolumn{3}{|l|}{Cost Structure}                                            & \multicolumn{3}{l|}{Revenue Streams}                                                     \\ \hline
\end{tabular}
\end{table}
\end{document}

Compiled LaTeX code

Suggestions how to create the correct cell alignment?

  • 1
    \multicolumn{3}{|p{5cm}|}{Cost Structure} Untested, because no testable document. – Johannes_B Aug 12 '17 at 11:23
  • 2
    Why the msword tag? – Johannes_B Aug 12 '17 at 11:24
  • Will this be all the text within the table? Or is there other text coming later? – Johannes_B Aug 12 '17 at 11:25
  • Why not simply use the table created in Word (using a matching font?) Seems simpler. – Johannes_B Aug 12 '17 at 11:25
  • I like it more when it's completely in LaTeX, that was my intention. – larkee Aug 12 '17 at 11:28
1

If you want to have equal widths cells, the simplest solution is to stack two tabularx environments of the same total width and adjust the vertical spacing between both. Anyway, your table can't fit the margins in normal size.

So I propose two variants, both with the \small font size. One has all cells one-lined, at the cost of enlarging the printable area for the table. This is done with the changepage package, and its adjustwidth environment. The other fits the margins, at the cost of some line breaks, and a redefinition of the X column type for the vertical alignment of cells contents.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{multirow, tabularx, caption, makecell}
\usepackage{changepage}

\begin{document}

\begin{table}[!htb]
\begin{adjustwidth}{-1.2cm}{-1.2cm}
\centering\small\captionsetup{skip=6pt, font=small}
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\caption{My caption}
\label{my-label}
 \begin{tabularx}{\linewidth}{|*{6}{X|}}
 \hline
 \multirow{2}{*}{Key Partnerships} & Key Activities & \multicolumn{2}{l|}{\multirow{2}{*}{Value Proposition}} & Customer Relationships & \multirow{2}{*}{Customer Segments} \\ \cline{2-2} \cline{5-5}
 & Key Resources & \multicolumn{2}{l|}{} & Channels & \\ \hline
 \multicolumn{3}{|p{\dimexpr0.5\linewidth-2\tabcolsep-2\arrayrulewidth}|}{Cost Structure} & \multicolumn{3}{p{\dimexpr0.5\linewidth-2\tabcolsep-2\arrayrulewidth}|}{Revenue Streams} \\ \hline
 \end{tabularx}\\[-0.5\extrarowheight]%\
\begin{tabularx}{\linewidth}{|*{2}{X|}}
Cost Structure & Revenue Streams \\ \hline
\end{tabularx}
\end{adjustwidth}
\end{table}

\begin{table}[!htb]
\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}}
\centering\small\captionsetup{skip=6pt, font=small}
\setlength{\extrarowheight}{2pt}
\caption{My caption}
\label{my-label}
 \begin{tabularx}{\linewidth}{|*{6}{X|}}
 \hline
 \multirow{2}{*}{Key Partnerships} & Key Activities & \multicolumn{2}{l|}{\multirow{2}{*}{Value Proposition}} & Customer \newline Relationships & \multirow{2}{*}{Customer Segments} \\ \cline{2-2} \cline{5-5}
 & Key Resources & \multicolumn{2}{l|}{} & Channels & \\ \hline
 \end{tabularx} \\ [-0.5\extrarowheight]%
\begin{tabularx}{\linewidth}{|*{2}{X|}}
Cost Structure & Revenue Streams \\ \hline
\end{tabularx}
\end{table}

\end{document} 

enter image description here

1

maybe like this:

enter image description here

\documentclass{article}
\usepackage{geometry}
\usepackage{multirow,tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage[skip=1ex]{caption}

\begin{document}
\begin{table}
\centering
\renewcommand\arraystretch{1.2}
\caption{My caption}
\label{my-label}
\begin{tabularx}{\linewidth}{|*{6}{L|}}
    \hline
\multirow{4}{=}{Key Partnerships}  & Key Activities
    & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep}X|}{Value Proposition}
        & Customer Relationships & \multirow{4}{=}{Customer Segments}   \\
    \cline{2-2} \cline{5-5}
        & Key Resources
            & \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep}X|}{}
                & \multirow{2}{=}{Channels}  &                                      \\ \hline
\multicolumn{3}{|>{\hsize=\dimexpr3\hsize+4\tabcolsep}X|}{Cost Structure}
    & \multicolumn{3}{>{\hsize=\dimexpr3\hsize+4\tabcolsep}X|}{Revenue Streams}     \\ \hline
\end{tabularx}
\end{table}
\end{document}

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.