[Tex/LaTex] Line-spacing in a cell of table

line-spacingtables

I'd like to change the line space of sentence in a cell of table.
It is not line-breaked, but over-flowed since the sentence is quite long in the cell.

My code example is below.
The line space is quite larger than cell space, which looks so bad.
Is there any way to make it narrow, only affecting in the cell?

Thanks in advance.

ps. Since I use \arraystretch which make cell-line small, line-space in the cell looks more bigger than cell-space.

\documentclass[10pt]{article}
\usepackage{booktabs,ctable,threeparttable}
\begin{document}
    \renewcommand{\arraystretch}{0.75}
    \begin{table}[t]
      \caption{Test}
      \begin{threeparttable}
         \begin{tabularx}{\textwidth}{c l X}
                                                             \FL
           No. & Code  & Name                                \ML[0.08em]
           01  & 01XXX & Agriculture, forestry and fishing   \NN
           02  & 05XXX & Manufacture of Electronic Components, Computer, 
                         Radio, Television and Communication Equipment and Apparatuses
                                                             \NN
           03  & 06XXX & Nursing                             \LL
         \end{tabularx}
         \label{tab:test}
       \end{threeparttable}
    \end{table}
\end{document}

Addtion.

This is how my table look.
enter image description here

Best Answer

\arraystretch only affects line spacing between table rows. In an X column, you can change the spacing between lines inside a cell by adjusting \baselineskip. Below is the same example coded in two slightly different ways, the first using \ctable, the other using your tabularx set-up. Notice the \ctable gives better spacing for the caption relative to the table.

Sample output

\documentclass[10pt]{article}

\usepackage{ctable}

\begin{document}

{\renewcommand{\arraystretch}{1.5}
\ctable[caption = Test,pos=htp,width=\textwidth]
{c l >{\setlength{\baselineskip}{1.5\baselineskip}}X}{}{
\FL
No. & Code  & Name                                \ML[0.08em]
01  & 01XXX & Agriculture, forestry and fishing   \NN
02  & 05XXX & Manufacture of Electronic Components, Computer, 
Radio, Television and Communication Equipment and Apparatuses
\NN
03  & 06XXX & Nursing                             \LL
}}

\begin{table}[htp]
  \renewcommand{\arraystretch}{1.5}
  \caption{Test}
  \begin{tabularx}{\textwidth}{c l >{\setlength{\baselineskip}{1.5\baselineskip}}X}
    \FL
    No. & Code  & Name                                \ML[0.08em]
    01  & 01XXX & Agriculture, forestry and fishing   \NN
    02  & 05XXX & Manufacture of Electronic Components, Computer, 
    Radio, Television and Communication Equipment and Apparatuses
    \NN
    03  & 06XXX & Nursing                             \LL
  \end{tabularx}
  \label{tab:test}
\end{table}

\end{document}

I demonstrated this with increasing the spacing, as this is more realistic. Squeezing will work too, just replace both 1.5 by 0.75 in the \arraystretch and the >{...}X, but it does not look too good. As Mico suggests, in such situations reducing font sizes is better. In both cases, note that the change to \arraystretch has been inside a group/environment, to prevent this affecting other places later in the document.

Related Question