Consider the following table. Some of the text in the second column is italic and also the text is broken in order to fit the column width.

This is the table that I am working on.

When the following code is used, it generates a table where the text can be formatted however the table grows outside the page boundary.

\caption{My caption}
\multirow{2}{*}{\textbf{S\#}} & \multicolumn{2}{c}{\textbf{Required Input}}   & \multirow{2}{*}{\textbf{Output}} \\ \cline{2-3}
                     & \textbf{1-level}   & \textbf{2-level} &   \\     \hline

E-call (EC) & Vehicle information, e.g., type and id, vehicle location,\ \textit{freight information, e.g., type and amount.} & Any output here. \ \hline \end{tabularx} \end{table}

See picture 2, which is the screenshot of the code:

enter image description here


2 Answers 2


Environment tabularx is already be used, only the usage of the column type X is missing. Also it seems the entries should be vertically centered, this can be achieved by the redefinition of \tabularxcolumn to internally use column type m instead of p. Also the example uses the lines of package booktabs.


  \caption{My caption}
    &\multicolumn{2}{c}{\textbf{Required Input}}
    & \multirow{2}{\linewidth}{%
      \centering\raisebox{-1ex}{\textbf{Output}}} \\
    & \textbf{1-level}   & \textbf{2-level} &   \\
    & Vehicle information, e.g., type and id, vehicle location,
      \textit{freight information, e.g., type and amount.}
    & Any output here \\



If I understand your question correctly, than you wish something like this: enter image description here

From your (not complete code) I made the following MWE:



\caption{My caption}
    &   \multicolumn{2}{c}{\thead{Required Input}}   
        &   \multirowcell{2}{\thead{Output}}    \\ 
    & \thead{1-level}   & \thead{2-level} &     \\     
1   & \itshape
        \textbf{vehicle information},
        eg. type and id,\newline 
        \textbf{freight information},
        eg., type and output
        &               & Any output here       \\

In preamble I add two packages: makecell and multirow, redefine \thead macro so, that the column heads are in boldface. For some words in table I uase textbf{...}.

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.