4

Here is the latex code to create a table in BibTxtMng

 \begin{table}[!htbp]
 \centering
 \caption{Spanish Traffic Sign according to the color and shape \cite{Paper12}}
  \begin{tabular}{|>{\raggedright}p{3.1cm}|>{\raggedright}p{3.1cm}|>
   {\raggedright}p{3.1cm}|}
   \hline
   Color          & Shape    & Meaning \tabularnewline
   \hline
    Red Rim        & Circle   & Prohibition\tabularnewline
    \hline
    Red Rim (Up)   & Triangle & Danger      \tabularnewline
    \hline
     Red Rim (Down) & Triangle & Yield       \tabularnewline
    \hline
        Red            & Octagonal & Stop\tabularnewline
    \hline
      Blue  & Square &  Recommendation \tabularnewline
       \hline
      Blue &    Circle &    Obligation \tabularnewline
     \hline
     White  & Circle    & End of Prohibition \tabularnewline
     \hline
    Yellow & Circle & End of Prohibition (construction)\tabularnewline
      \hline
       \end{tabular}
       \label{Spanish_TS}
       \end{table}

Here is the output table I got

enter image description here

I want that yellow and circle text (in the last row) being located in the centre of vertical. Not tin the top like that..

How to do it??

5

You can use m column specifier for the last cell in last row.

\documentclass{article}
\usepackage{array}             %% you need this
\begin{document}
   \begin{table}[!htbp]
 \centering
 \caption{Spanish Traffic Sign according to the color and shape \cite{Paper12}}
  \begin{tabular}{|>{\raggedright}p{3.1cm}|>{\raggedright}p{3.1cm}|>
   {\raggedright}p{3.1cm}|}
   \hline
   Color          & Shape    & Meaning \tabularnewline
   \hline
    Red Rim        & Circle   & Prohibition\tabularnewline
    \hline
    Red Rim (Up)   & Triangle & Danger      \tabularnewline
    \hline
     Red Rim (Down) & Triangle & Yield       \tabularnewline
    \hline
        Red            & Octagonal & Stop\tabularnewline
    \hline
      Blue  & Square &  Recommendation \tabularnewline
       \hline
      Blue &    Circle &    Obligation \tabularnewline
     \hline
     White  & Circle    & End of Prohibition \tabularnewline
     \hline
    Yellow & Circle & \multicolumn{1}{|m{3.1cm}|}{End of Prohibition (construction)}\tabularnewline
      \hline
       \end{tabular}
       \label{Spanish_TS}
       \end{table}
\end{document}

enter image description here

You may use the m column specifier for all columns if you have variable width text in them to have vertical alignment.

|improve this answer|||||
  • Or even in all columns. – egreg Apr 1 '14 at 13:44
  • @egreg probably yes, to be on the safer side. :) – user11232 Apr 1 '14 at 13:45
2

If you are willing to manually do the linebreaks within a row yourself, you can use a \Centerstack, as shown here. In that case though, the p columns are not really needed, unless you want them for their width. You can dispense with them by deleting that declaration and uncommenting the 3 other lines in my code.

\documentclass{article}
\usepackage{array}
\usepackage[usestackEOL]{stackengine}
%\edef\tmp{\the\baselineskip}
%\setstackgap{L}{\tmp}
\begin{document}
   \begin{table}[!htbp]
 \centering
 \caption{Spanish Traffic Sign according to the color and shape \cite{Paper12}}
%\begin{tabular}{|l|l|l|}
  \begin{tabular}{|>{\raggedright}p{3.1cm}|>{\raggedright}p{3.1cm}|>{\raggedright}p{3.1cm}|}
   \hline
   Color          & Shape    & Meaning \tabularnewline
   \hline
    Red Rim        & Circle   & Prohibition\tabularnewline
    \hline
    Red Rim (Up)   & Triangle & Danger      \tabularnewline
    \hline
     Red Rim (Down) & Triangle & Yield       \tabularnewline
    \hline
        Red            & Octagonal & Stop\tabularnewline
    \hline
      Blue  & Square &  Recommendation \tabularnewline
       \hline
      Blue &    Circle &    Obligation \tabularnewline
     \hline
     White  & Circle    & End of Prohibition \tabularnewline
     \hline
    Yellow & Circle & \Centerstack[l]{End of\\ Prohibition\\ (construction)}\tabularnewline
      \hline
       \end{tabular}
       \label{Spanish_TS}
       \end{table}
\end{document}

enter image description here

|improve this answer|||||

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.