The following LaTeX code produces a table with one row and three columns. Each cell contains two short words word-wrapped so that one name is above the other. A design requirement of this table is the ability to force a word-wrap on a short sentence and control cell padding.  \documentclass[twoside]{report} \usepackage{array} \newcolumntype{M}{&gt;{\centering\let\newline\\\arraybackslash\hspace{2pt}}m{1cm}} \makeatletter \begin{document}         \begin{tabular}{|M|M|M|}             \hline             Sue Tim &amp;  Sam Jake &amp;  Eddy John  \\[3ex]             \hline         \end{tabular} \end{document}   This code will produce the following output:    The problem here is that the last cell is not vertically centered like the other two cells. Vertical padding is controlled by \\[3ex] on line 8 while horizontal padding is controlled by m{1cm} on line 3.  How can I modify this code so that the last cell looks like the first two cells?
9251
Unfortunatly, I have a problem with m-columns (array package) in tables with adjusted row height. Somehow in the last column (only there) the text is not centered vertically.  Check it out:    \documentclass{article} \usepackage{array}  \begin{document}  \begin{tabular}{|m{0.18cm}|m{0.18cm}|m{0.18cm}|} \hline a &amp; b &amp; c  \\[2ex] \hline 0 &amp; 0 &amp; 0  \\ \hline \end{tabular}  \end{document}
54749
I want a table whose first column is aligned top, second column is aligned middle, and third column is aligned bottom; like this:    I wrote the following code:  \documentclass{article} \usepackage[english]{babel} \usepackage{array}  \begin{document}  \begin{tabular}{| p{1cm} | m{1cm} | b{1cm} |}     \hline     x &amp;     A long text comes here &amp;     x \\ \hline \end{tabular}  \end{document}   Yet, to my surprise, the outcome was "all columns aligned middle," as follows:    What did I do wrong?
14384
still working on that table. Here's my new question reguarding the table borders:  It appears, that i do something wrong setting boarders. Here is my code, and a screenshot:  \documentclass{article} \usepackage{multirow} % Used for the vertical cells \usepackage{rotating} % Used for the vertical cells  \usepackage{xcolor} % Used for cell-colors \usepackage{colortbl} % Used for cell-colors  \usepackage[a4paper]{geometry}% Used to set the pdf margins manually \newgeometry{left=2cm,bottom=0.1cm}  \definecolor{grey}{HTML}{F2F2F2} % Define grey for the cells \definecolor{red}{HTML}{FF0000} % Define red for testing  \begin{document} \scriptsize % Use a small font size  \begin{tabular}{|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0,6cm}|}  \cline{10-17}  \multicolumn{9}{|c|}{} &amp; \multicolumn{2}{p{\dimexpr (0.6cm)*2+2\arrayrulewidth+2\tabcolsep\relax}|}{\cellcolor{grey}Work to retired ratio} &amp; \multicolumn{4}{p{\dimexpr (0.6cm)*4+1\arrayrulewidth+2\tabcolsep\relax}|}{Health care sizing (per thousand)} &amp; \multicolumn{2}{p{\dimexpr (0.6cm)*2+1\arrayrulewidth+2\tabcolsep\relax}|}{\cellcolor{grey}Inverse dependency ratio}\\\cline{3-9}  \multicolumn{2}{|c|}{} &amp; \multicolumn{4}{c|}{\cellcolor{grey}Population (mio.)} &amp; \multicolumn{3}{c}{Workforce (1000)}  &amp; \multicolumn{2}{|c|}{\cellcolor{grey}} &amp; \multicolumn{2}{l|}{Physicians by} &amp; \multicolumn{2}{l}{Nurses by} &amp; \multicolumn{2}{|l|}{\cellcolor{grey}Old agers by}\\\hline  \multicolumn{2}{|c|}{} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Overall}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Young age}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Overall}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Physicians (Proj: 2025)}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Nurses (Proj: 2030)}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}Working age by Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}Work force by Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Workforce}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Workforce}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}1 physicians}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}1 nurse}\end{sideways}\\\hline  \multicolumn{2}{|l}{USA} &amp; \multicolumn{4}{l}{\cellcolor{grey}} &amp; \multicolumn{3}{l}{} &amp; \multicolumn{2}{l}{\cellcolor{grey}} &amp; \multicolumn{4}{l}{} &amp; \multicolumn{2}{l|}{\cellcolor{grey}}\\\hline  1990/1 &amp; &amp; 248,6 &amp; 71,3 &amp; 146,1 &amp; 31,2 &amp; 127.500 &amp; 615,4 &amp; 1491,6 &amp; 4,68 &amp; 4,09 &amp; 4,83 &amp; 4,21 &amp; 11,70 &amp; 10,21 &amp; 50,7 &amp; 20,9\\\hline  1 &amp; 2 &amp; 3 \\\hline  \end{tabular}  \end{document}     On 1 the Top border of Population is not visible although i did used \\\cline{3-9}\cline{12-17} on that line.  In 2 both borders are pushed a bit to the right for no reason i can see.  And in 3 again the top borders are not visible despite using \cline{10-17} on that line. What did i do wrong?  Thanks!
16419
Im trying to create a multicolumn table in LaTex that would look like this:     Unfortunately I tried pretty much all the codes for multi row and multi column tables but it never looks even remotely similar. My main problem is to fit the Chronological periods on top of the 2 names.  The last code I tried was:  \documentclass[11pt]{article} \begin{document}  \begin{left} \begin{tabular}{|lc|ll|l|ll|}  \hline  {\bfseries Bronze Age} &amp; {} &amp; {\bfseries Iron Age} &amp; {} &amp;{\bfseries    Hellenistic}  &amp; {\bfseries Roman}\\  \hline  \multirow {Kilise Tepe &amp; Ephesos &amp; Kilise Tepe  &amp; Ephesos &amp; Gordion &amp;  Ephesos&amp; Sagalassos}\\ \hline \end{tabular} \end{left}   \end{document}   Could someone please put me in the right direction?  Thank you in advance.
89488
How to exactly make a rotated, multiple-row label (i.e., from) of a table vertically centered?  \documentclass[preview,border=12pt,12pt]{standalone} \usepackage{array,multirow,graphicx}  \begin{document} \begin{tabular}{|*5{c|}} \cline{3-5} \multicolumn{2}{c|}{\multirow{2}{*}{}} &amp; \multicolumn{3}{c|}{to}\\\cline{3-5} \multicolumn{2}{c|}{}                     &amp; a &amp; b &amp; c\\\hline \multirow{4}{*}{\rotatebox{90}{from}} &amp; 1 &amp; d &amp; e &amp; f\\\cline{2-5}                                       &amp; 2 &amp; g &amp; h &amp; i\\\cline{2-5}                                       &amp; 3 &amp; j &amp; k &amp; l\\\cline{2-5}                                       &amp; 4 &amp; m &amp; n &amp; o\\\hline \end{tabular} \end{document}
114854
I have an issue making a long list with wrapped text. The table can be several page long. I use longtable and assign the width for each column but as soon as I put it in the \begin{table} \end{table}, it does not work. It clips the table. I want to make a label for the table so I put it in the table environment.  And is there a way to automatically adjust the width so that I don't need to assign the value manually?  Thank you.   Tung  \begin{table} \centering \begin{longtable}{|p{6.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|} \hline Name                                      &amp; Company     &amp;  Catalog Number   &amp;   Comments    \\ \hline Small DNA FRAG Extract Kit-100PR          &amp; VWR         &amp;   97060-558 &amp; \\ \hline Acrylamide 40\% solution 500 mL           &amp; VWR         &amp;   97064-522 &amp;  \\ \hline Bis-acrylamide 2\% (w/v) solution 500 mL  &amp; VWR         &amp;   97063-948 &amp;  \\ \hline GeneRuler 100 bp DNA Ladder, 100-1,000 bp &amp; Fermentas   &amp;   SM0241  &amp;    \\ \hline Mini Vertical PAGE System                 &amp; VWR         &amp;   89032-300  &amp;  \\ \hline \end{longtable} \label{tab:list} \end{table}
110921
How can one format a cell to have word wrap in Google Sheets?  I've tried Shift+Enter, but that doesn't seem to work.  One thing I know works is to place  and then if you edit your cell you can have word wrap in it.  But is there a way to do this without switching modes?
98072
I am trying to create a \multirow and \multicolumn table in the Texmaker. I have specified to put vertical lines in the code but somehow my last column is missing partially the vertical line. I have posted my code below. Could someone help me out to understand where am I wrong? Thanks a lot in advance.  \begin{table}[h]    \centering    \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|} \hline    Macrophase &amp; \multicolumn{2}{|c|}{Activity} \ \hline    \multirow{8}{*}{} &amp; Description &amp; \ \cline{2-3}    &amp; Macrophase Actors \ \cline{2-3}    &amp; Duration and Frequency \ \cline{2-3}    &amp; Inputs \ \cline{2-3}    &amp; Software Utilized \ \cline{2-3}   &amp; Outputs \ \cline{2-3}   &amp; Criticalities \ \cline{2-3}   &amp; KPIs \ \hline   \end{tabular}   \caption{caption}   \label{table:sample}   \end{table}
77395
I am trying to create linebreaks in some of the cells of my table, since I have long sentences and the table doesn't fit on an A4 page. How to let LaTeX choose the linebreaks?  Here is my code   \begin{table}[hbt] \centering \begin{tabular}{lllllll}     \toprule     &amp;  Raumgewicht $\gamma$'$_m$ and [$\frac{kN}{m^3}$] &amp;Reibungswinkel $\phi$'$_m$[]&amp; Kohäsion c'[] &amp; M$_E$-Wert []&amp; N$_SPT$ [] &amp; k-Wert []  \\     \midrule     Auffüllungen/Deckschicht&amp; 18&amp; 27 &amp; 0 &amp; 10* &amp; 17 &amp; -\\     Rückstausedimente nicht vorbelastes&amp; 21 &amp; 28 &amp; 10 &amp; 10 &amp; 15 &amp; $5\times10^-8$ - $1\times10^-6$ \\     Rückstausedimente vorbelastet &amp; 22 &amp; 32 &amp; 10 &amp; &gt;50 &amp; 91 &amp; $5\times10^-8$ - $1\times10^-6$ \\     Moräne &amp; 22 &amp; 36 &amp; 5 &amp; &gt;50 &amp; &gt;100 &amp; $1\times10^-8$ - $5\times10^-6$\\     \bottomrule \end{tabular} \caption{Bodenkennwerte} \label{tab:Bodenkennwerte} \end{table}   My preamble is  \documentclass[12pt,a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{booktabs} \usepackage{stackengine} \usepackage[top=3cm, bottom=2.5cm, left=2.5cm, right=2.5cm, footskip = 1cm]{geometry} \usepackage{hyperref}
43240
This question is a follow up to my :  Is it possible to use &gt; and &lt; to pipe opening and closing braces on each side of a cell's content? To be more specific, what I want is to define the following column:  \newcolumntype{P}{&gt;{\leavevmode\kern-\tabcolsep\bfseries\parbox[t]{\hsize}{}X&lt;{}}}   I want a column type that automatically embraces the cell content in a \parbox.  I enclose a short MNWE:  \documentclass[table]{article} \usepackage{lmodern, microtype, xcolor, tabularx, tabulary}  \begin{document}  \begin{tabularx}{0.5\columnwidth}{&gt;{\raggedright\arraybackslash\leavevmode\kern-\tabcolsep\parbox[t]{\hsize}{ }X&lt;{}}XX&lt;{\leavevmode\kern-\tabcolsep\raggedleft\arraybackslash}}  \rowcolor{lightgray}All this testing is not so funny&amp;test&amp;test\\\hline testing, testing and even more testing &amp;test&amp;test\\ \rowcolor{lightgray}I want to write a noce table in a simple way&amp;test&amp;test\\ \end{tabularx}  \end{document}
40764
I am developing some tables on LaTeX environment and I am having some troubles with the spacing. Originally, I was able to generate the tables using the standard \begin{table}, but then I tried to add some features, as the capability to break the table if it is too long (using longtable) the issue appears. I also want to align numbers by decimal point and center, reason why I use siunitx package. The problem is on the last column, which had a width almost the double than the others. If I specify the column width, the problem "disappear", but I'm really interested in the possibility of automatically generate the width of the table.  The code is the following:  \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage[english]{babel} \usepackage{siunitx} \usepackage{longtable} \usepackage{booktabs}  \begin{document} \begin{longtable}{l*{4}{S}} % no problem specifying the column width\begin{longtable}{l*{4}{S[table-column-width=1.25cm]}} \caption{Univariate Item Descriptives}\\ \toprule \multicolumn{1}{l}{\textbf{Item}} &amp; \multicolumn{1}{c}{\textbf{Mean}} &amp;    \multicolumn{1}{c}{\textbf{Variance}} &amp; \multicolumn{1}{c}{\textbf{Skewness}} &amp; \multicolumn{1}{c}{\textbf{Kurtosis}} \\ \midrule \endfirsthead \multicolumn{5}{c}% {\tablename\ \thetable\ -- \textit{Univariate Item Descriptives (Continued from previous page)}} \\ \toprule \textbf{Item} &amp; \textbf{Mean} &amp; \textbf{Variance} &amp; \textbf{Skewness} &amp; \textbf{Kurtosis} \\ \midrule \endhead \hline \multicolumn{5}{r}{\textit{Continued on next page}} \\ \endfoot \bottomrule \endlastfoot 2. EX +         &amp; 2.788   &amp;    1.060 &amp;        -0.120   &amp;   -0.368\\ 3. DS +         &amp; 4.080   &amp;    0.853 &amp;        -1.141   &amp;    1.379\\ 4. AM +         &amp; 3.684   &amp;    0.705 &amp;        -0.541   &amp;    0.744\\ 5. EX +         &amp; 3.653   &amp;    1.043 &amp;        -0.709   &amp;    0.149\\ 6. DS -         &amp; 2.240   &amp;    1.665 &amp;         0.725   &amp;   -0.603\\ 7. AM +         &amp; 4.292   &amp;    0.876 &amp;        -1.627   &amp;    2.705\\ 8. EX -         &amp; 2.419   &amp;    1.588 &amp;         0.449   &amp;   -0.897\\ 9. AM +         &amp; 3.255   &amp;    0.923 &amp;        -0.234   &amp;   -0.037\\ 10. DS -        &amp; 3.449   &amp;    1.408 &amp;        -0.453   &amp;   -0.599\\ 11. EX +        &amp; 3.678   &amp;    1.232 &amp;        -0.669   &amp;   -0.219\\ 12. AM -        &amp; 2.830   &amp;    1.162 &amp;         0.029   &amp;   -0.565\\ 13. EX -        &amp; 3.452   &amp;    1.205 &amp;        -0.410   &amp;   -0.336\\ 14. DS -        &amp; 2.442   &amp;    1.374 &amp;         0.310   &amp;   -0.893\\ 15. AM -        &amp; 2.114   &amp;    1.168 &amp;         0.729   &amp;   -0.176\\ 16. EX -        &amp; 3.070   &amp;    1.085 &amp;        -0.176   &amp;   -0.347\\ 17. AM +        &amp; 3.893   &amp;    1.116 &amp;        -0.954   &amp;    0.544\\ 18. EX +        &amp; 3.311   &amp;    0.964 &amp;        -0.238   &amp;   -0.066\\ 19. AM -        &amp; 2.674   &amp;    1.404 &amp;         0.245   &amp;   -0.780\\ \end{longtable} \end{document}
42944
Consider this example:  \begin{enumerate}     \item Blablabla bla bla bla.         \begin{tabular}{l}             Lorem ipsum dolor sit amet.\\             Consectetur adipiscing elit.\\             Donec eu ante non mi sagittis molestie.\\         \end{tabular}     \item Next question \end{enumerate}   LaTeX will vertically center the table, which looks pretty weird. It basically looks like this:                            Lorem ipsum dolor sit amet. 1. Blablabla bla bla bla. Consectetur adipiscing elit.                           Donec eu ante non mi sagittis molestie.   How can I manage for the consecutive lignes to line up under the first one (with the same margin)? Something which would look like this:  1. Blablabla bla bla bla. Lorem ipsum dolor sit amet.                           Consectetur adipiscing elit.                           Donec eu ante non mi sagittis molestie.   Any ideas?  Thanks!
15263
How can I vertically center the content in the cells of the left table (marked 1) so that it looks like the cells of the right table (marked 2):    My code thus far:  \begin{table}[H]     \setcellgapes{5pt}     \makegapedcells     \caption{Local Area Network vs Wide Area Network.}     \label{tab:lanvswan}     \centering     \begin{tabular}{         &gt;{\centering\arraybackslash}p{3.5cm}         |&gt;{\centering\arraybackslash}p{4.5cm}         |&gt;{\centering\arraybackslash}p{4.5cm}         }         \thead{Características}     &amp; \thead{LAN}                           &amp; \thead{WAN}                                                       \\  \hline         Extensión Geográfica        &amp; Pequeña                               &amp; Extensa                                                           \\  \hline         Dispositivos                &amp; Host, Switches (L2 y L3) y Routers    &amp; Especializados de ATM y Frame Relay, Switches (L3) y Routers      \\  \hline         Tecnologías                 &amp; Ethernet                              &amp; MPLS, ATM, Frame Relay y X.25     \end{tabular} \end{table}
122147
I am trying to code a command in LaTeX to type the . You can see in the Wikipedia link above that these are rather simple tables. There is a vertical line at the beginning, after the first column, and there is a horizontal line at the end, before the last row.   I would like to have a command that I can pass the numerical entries of the table and ir draw the rest.   How to do this?  I would like something like \ruffini{...} and in entries we either enter the list of numbers, perhaps separated by commas. Or maybe even entering the numbers with the separators &amp; and \\ to format in what position the go in the table. But I wouldn't want to be thinking about the lines in the table. I would like the command to take care of the line.
84421
I'm trying to create a multi-page table with all cells having the same height (as well as certain fixed widths) so that certain manual cut-and-paste operations are a lot easier.  One issue is that one column in particular is text-heavy and should line-break within the cell.  As I don't want it justified, I looked into alternatives such as .  This is doing exactly what I want for horizontal alignment.  For vertical alignment, I've looked at  and the \vphantom method detailed in the above link doesn't seem to be working.  Here's what I'm currently working with:  \documentclass[11pt]{article} \usepackage{array}  \newcolumntype{P}[1]{&gt;{\raggedright\hspace{0pt}\arraybackslash}p{#1}} \def\Z{\vphantom{\parbox[c]{1.7in}{\Huge Something Long}}}  \begin{document} \begin{tabular}{| c || P{0.5in} || P{0.5in} || P{5in} |}\hline  1.  \Z &amp;&amp;&amp; Long long long long long long long long long             long long long long long long long text  \\\hline 2.  \Z &amp;&amp;&amp; More long long long long long long long long             long long long long long long long text  \\\hline \end{tabular}   When I compile, the cells do not have a uniform height, and none of them are as large as 1.7 inches vertically.  So this suggests that somehow the \vphantom method is failing.  Does anybody know of a relatively straightforward solution to this problem?
53265
Possible Duplicate:          I am trying to create a table after some text:  Some text. foobar foobar \\  \begin{table}[t] \centering \begin{tabular}{|c|c|c|c|c|c|} \hline  &amp; a &amp; c &amp; &amp; &amp;  \\ \hline $\{X, X', Y\}$ &amp; &amp; b &amp;  &amp; &amp;  \\ \hline \hline \end{tabular} \end{table}   However, the table is appearing before the text even though I type if after I type the text. Why?
21071
I have 5 columns in my table. So I want to reduce distance between two columns to make it look good. In the following figure, I want to reduce distance between column 1 and 2.   I tried \setlength{\tabcolsep}{5pt} but it didn't look good. I want top row to take only two rows, not three. how do I do that?    \usepackage{tabularx,booktabs}  \usepackage{array} \newcolumntype{Z}{&gt;{\centering\let\newline\\\arraybackslash\hspace{0pt}}X} \newcolumntype{C}{&gt;{\centering\let\newline\\\arraybackslash\hspace{0pt}}p}  \begin{table}[t] \caption{Case studies} \centering  \begin{tabularx}{\textwidth}{C{3cm}*5{Z}}     \toprule  Nature of unreliability &amp;  Sender SST &amp;  Receiver SST &amp;  Implementation SST &amp;  Retransmission Bound \\      \midrule  Noisy (Single fixed error message) &amp; DSST &amp; DSST &amp; DSST &amp; Unbounded \\ \bottomrule \end{tabularx} \label{case-studies} \end{table}