# In a multi-column table, is there a way to change only SOME text in a specific column (and not the entire column) to be bold or italic?

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.

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

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabularx}{0.7\textwidth}{llll}
\hline
\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:

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.

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{multirow}
\usepackage{tabularx}

\begin{document}
\begin{table}
\centering
\caption{My caption}
\label{my-label}
\renewcommand*{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\linewidth}{
c
>{\raggedright}X
>{\raggedright}X
>{\raggedright\arraybackslash}X
}
\toprule
\multirow{2}{*}{\raisebox{-1ex}{\textbf{S\#}}}
&\multicolumn{2}{c}{\textbf{Required Input}}
& \multirow{2}{\linewidth}{%
\centering\raisebox{-1ex}{\textbf{Output}}} \\
\cmidrule{2-3}
& \textbf{1-level}   & \textbf{2-level} &   \\
\midrule
1
& Vehicle information, e.g., type and id, vehicle location,
\textit{freight information, e.g., type and amount.}
&
& Any output here \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}


If I understand your question correctly, than you wish something like this:

\documentclass{article}

\usepackage{makecell,multirow,tabularx}
\newcolumntype{R}{>{\raggedright\arraybackslash}X}

\begin{document}
\begin{table}[h]
\centering
\small
\caption{My caption}
\label{my-label}
\begin{tabularx}{\textwidth}{cRRR}
\hline
\cline{2-3}
\hline
1   & \itshape
\textbf{vehicle information},
eg. type and id,\newline
\textbf{freight information},
eg., type and output
&               & Any output here       \\
\hline
\end{tabularx}
\end{table}
\end{document}


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{...}.