I am trying to create a graph in Latex with the given code:  \documentclass[11pt]{article}  \begin{document}  \begin{table}[H]    \centering   \caption{A table showing the raw data.}   \vspace{0.3cm}     \begin{tabular}{|c|c|c|c|}     \multicolumn{1}{l}{\textit{Height, $h$/$\SI{}{cm}$ ($\pm \SI{1.00}{cm}$) }} &amp; \multicolumn{3}{c}{\textit{Horizontal Distance Travelled, $x$/$\SI{}{cm}$ ($\pm \SI{0.100}{cm}$)}} \\     \hline           &amp; 1     &amp; 2     &amp; 3 \\           \hline     2.40  &amp; 17.9  &amp; 18.5  &amp; 18.3 \\     3.40  &amp; 24.0  &amp; 24.3  &amp; 25.0 \\     5.10  &amp; 27.4  &amp; 28.1  &amp; 28.6 \\     7.10  &amp; 34.8  &amp; 36.0  &amp; 36.4 \\     9.00  &amp; 38.0  &amp; 38.7  &amp; 39.0 \\     12.0  &amp; 45.7  &amp; 45.3  &amp; 44.7 \\     15.0  &amp; 50.5  &amp; 48.4  &amp; 48.4 \\     18.0  &amp; 55.0  &amp; 57.2  &amp; 57.3 \\     21.0  &amp; 60.6  &amp; 60.2  &amp; 58.2 \\     24.0  &amp; 56.9  &amp; 62.4  &amp; 64.0 \\     25.6  &amp; 62.3  &amp; 63.3  &amp; 64.2 \\     \hline     \end{tabular}%   \label{tab:addlabel}% \end{table}%  \end{document}   But when I compile, the table looks very uneven:     What is causing the table to align itself in this way and how can I fix this issue?  The latex code here has been changed to the code I meant. The other question was a mistake that I would like to delete.  Thanks, Aidanaidan12
124174
I am trying to create a graph in Latex with the given code:  \begin{table}[htbp]   \centering   \caption{Table showing the processed data.}     \scalebox{0.7}{     \begin{tabular}{|c|c|c|c|}     \hline     \multicolumn{1}{l}{Average distance, x/ $\SI{}{cm}$} &amp; \multicolumn{1}{l}{Uncertainty in average distance/ $\pm \SI{}{cm}$} &amp; \multicolumn{1}{l}{Average distance squared/ $\SI{}{cm^2}$} &amp; \multicolumn{1}{l}{Uncertainty in average distance squared / $\pm \SI{}{cm^2}$} \\     \hline     18.2  &amp; 0.3   &amp; 332   &amp; 10.9 \\     24.4  &amp; 0.5   &amp; 597   &amp; 24.4 \\     28.0  &amp; 0.6   &amp; 786   &amp; 33.6 \\     35.7  &amp; 0.8   &amp; 1280  &amp; 57.2 \\     38.6  &amp; 0.5   &amp; 1490  &amp; 38.6 \\     45.2  &amp; 0.5   &amp; 2050 &amp; 45.2 \\     49.1  &amp; 1.1   &amp; 2410 &amp; 103.1 \\     56.5  &amp; 1.2   &amp; 3190 &amp; 130.0 \\     59.7  &amp; 1.2   &amp; 3560 &amp; 143.2 \\     61.1  &amp; 3.6   &amp; 3730 &amp; 433.8 \\     63.3  &amp; 1.0   &amp; 4000 &amp; 120.2 \\     \hline     \end{tabular}     }   \label{tab:addlabel}% \end{table}%   But when I compile, the table looks very uneven:   What is causing the table to align itself in this way and how can I fix this issue?  Thanks, Aidanaidan12
66655
I tried to combine this answer  with my answer  But the pdflatex -shell-escape table.tex ignores linebreaks and the 3 tables are horizontally aligned and not vertically. table.tex \documentclass[convert]{standalone} % \documentclass{article}  \usepackage{booktabs} % for nice lines \usepackage{siunitx}  % nice numbers and units and 'S' in table \usepackage{multirow} % enable \multirow command  \begin{document} short answer to your question:\\ \begin{tabular}{|c|c|S|} \hline Genre &amp; Name &amp; {Weight}\\\hline Humain &amp; Aragorn &amp; 102 \\\hline \multirow{4}{*}{Hobbit}&amp;Frodon &amp; 32.1\\\cline{2-3}     &amp;Sam &amp; 3.2 \\\cline{2-3}     &amp;Peregrin &amp; 2.232\\\cline{2-3}     &amp;Meriadoc &amp; 23 \\\hline Elfe&amp;Legolas &amp; 34.5 \\\hline \end{tabular}\\[1cm]   You can also use the power of booktabs and siunitx:\\ \begin{tabular}[ht]{l c S} % alignment l = left, c = centre, S = at decimal - needs siunitx \toprule Genre&amp;Name&amp; {Weight}\\  % protect non numbers with {} in S columns \midrule Elfe&amp;Legolas &amp; 34.5\\ Dwarf&amp;Peter &amp; 103.31\\ \bottomrule \end{tabular}\\[1cm]  And combine that with your table:\\ \begin{tabular}{c c S} \toprule Genre &amp; Name &amp; {Weight}\\\midrule Humain &amp; Aragorn &amp; 102 \\\midrule \multirow{4}{*}{Hobbit}&amp;Frodon &amp; 32.1\\\cline{2-3}     &amp;Sam &amp; 3.2 \\\cline{2-3}     &amp;Peregrin &amp; 2.232\\\cline{2-3}     &amp;Meriadoc &amp; 23 \\\midrule Elfe&amp;Legolas &amp; 34.5 \\ \bottomrule \end{tabular}   \end{document}
47848
I want to align two numbers in two different rows the decimal point.    I do see a link for that here:   However, I don't understand how to incorporate that into my code.  What follows is a reduced version of my code.  \documentclass[12pt,english]{article} \usepackage{longtable} \usepackage{fullpage} \usepackage{times} \usepackage[flushleft]{threeparttable} \usepackage[font=large,labelfont=bf,tableposition=top,textfont=bf]{caption} \usepackage{tabularx} \usepackage{booktabs} \newcolumntype{C}{&gt;{\centering\arraybackslash}X}  \begin{document}  \clearpage \newpage \begin{table}[!ht] \caption{Table Title} \def\arraystretch{1.05} \vspace{-0.2cm} \begin{threeparttable} \small \begin{tabularx}{\textwidth}{l*{10}{C}} \hline \hline \addlinespace &amp; (1)  \\   Variable Name &amp; 0.1234566  \\ &amp; (0.1234566) \\ \hline \hline \addlinespace  \end{tabularx} \begin{tablenotes} \vspace{0.1cm} \footnotesize{  \item \noindent \hspace{-1.8mm} Notes:    \noindent Sources:   } \end{tablenotes} \end{threeparttable} \end{table}  \end{document}
21495
I'm colorizing the header of a table formatted with column -ts $'\t'  Works well without color codes, but when I add color codes to the first line column doesn't properly align the output.  Without colored output it works as expected: printf "1\t2\t3\nasdasdasdasdasdasdasd\tqwe\tqweqwe\n" | column -ts $'\t'  But when adding color on the first line column doesn't align the text of the colored row: printf "\e[7m1\t2\t3\e[0m\nasdasdasdasdasdasdasd\tqwe\tqweqwe\n" | column -ts $'\t'  Observed this behaviour both on Ubuntu Linux and Mac OS X.
18660
After MIKTEX package updates vertical m-column alignment in tabu does not work anymore. See MWE below  \documentclass{article} \usepackage{tabu}  \begin{document}  \tabulinesep=3pt   Result using tabu:  \begin{tabu} to \linewidth {|X[p]| X[m]| X[b]|}     \hline     \centering header p &amp;     \centering header m &amp;        \centering header b \tabularnewline     \hline     text which is considerably longer than the width of the column  &amp;      text which is considerably longer than the width of the column  &amp;      text which is considerably longer than the width of the column      \tabularnewline     \hline \end{tabu}  \vspace*{1cm}  Result using tabular:  \begin{tabular}{|p{0.3\linewidth}|m{0.3\linewidth}|b{0.3\linewidth}|}     \hline     \centering header p &amp;     \centering header m &amp;        \centering header b \tabularnewline     \hline     text which is considerably longer than the width of the column  &amp;      text which is considerably longer than the width of the column  &amp;      text which is considerably longer than the width of the column      \tabularnewline     \hline \end{tabular}   \end{document}   The results is:   Both tables should be equal but m-column in tabu is broken.Does anyone know which package is responsible for that? Here is the list of packages that were updated:
45029
I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that  \usepackage{array} \begin{tabular}{| c | c | m{5cm} |}   vertically centers the text in the last column, but justifies it horizontally (like text in normal paragraphs).  Update: With Jake's method, it seems both \\ and \hline cause an error. How to fix it?
11621
I have the code:  \documentclass{article} \usepackage[a4paper]{geometry} \usepackage{tabularx} \usepackage{lipsum} \begin{document} \begin{tabularx}{\textwidth}{ | X | c | }   \hline   \lipsum[1] &amp; top\\   \hline   \lipsum[1] &amp; center\\   \hline   \lipsum[1] &amp; bottom\\   \hline \end{tabularx} \end{document}   Gives this:    The top row is already aligned top. How can I vertically align the center row at the center? And the bottom row at the bottom?
71922
Suppose I have the following table in my TeXstudio editor:      Latex &amp; 360 &amp; 101.77 &amp; 10.71 &amp; 101.86 &amp; 64.60 &amp; 127.20  \\      Manufacturing &amp; 360 &amp; -7.33 &amp; 12.59 &amp; -7.24 &amp; -49.00 &amp; 22.00  \\      Cons &amp; 360 &amp; -17.19 &amp; 23.4 &amp; -17.22 &amp; -79.00 &amp; 43.00 \\      Apple and Orange &amp; 360 &amp; 3.38 &amp; 13.84 &amp; 3.60 &amp; -47.00 &amp; 29.00   \\      Services and Harry  &amp; 104 &amp; -4.96 &amp; 20.8 &amp; -4.81 &amp; -57.00 &amp; 30.00   \\      Manchester &amp; 360 &amp; -9.29 &amp; 8.64 &amp; -9.26 &amp; -35.00 &amp; 8.00 \\    Sometimes I want to change some numbers in the table. However, it is really really hard to keep tracking which number is behind the other in the table. Is there is any way to align the &amp; behind each other?
99101
In this table with some big numbers the column headers centered over the decimal point look odd to me. And, too, the columns seem a little too wide.    I've puttered a bit with other answers here and package documentation to little effect. Maybe I haven't looked hard enough - so am asking for help.  Here's the MWE:  \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \sisetup{input-ignore={,},input-decimal-markers={.},group-separator={,}}  \begin{document} \begin{tabular}{lSSS} \toprule           &amp;            &amp;            &amp; \multicolumn{1}{c}{Natural} \\ Time unit &amp; \multicolumn{1}{c}{Births} &amp; \multicolumn{1}{c}{Deaths} &amp; \multicolumn{1}{c}{increase} \\  \midrule Year  &amp;    134,176,254 &amp;   56,605,700 &amp;    77,570,553 \\ Month &amp;     11,181,355 &amp;    4,717,142 &amp;    6,464,213 \\ Day   &amp;        367,606 &amp;      155,084 &amp;       212,522 \\ Minute&amp;            255 &amp;          108 &amp;           148 \\ Second&amp;            4.3 &amp;          1.8 &amp;           2.5 \\ \bottomrule \end{tabular} \end{document}
26286
How do I code a table to look like this? I'm not the best at LaTeX and can't seem to wrap my head around \multirow. I checked other examples prior to posting but they used \multicolumn and it just confused me even more. Thanks in advance!    \begin{center} \begin{tabular}{ |c|c|c|c|c|}   \hline  TextA &amp; TextB &amp; TextC &amp; TextD &amp; TextE\\  \hline  A &amp; TextF &amp; TextG &amp; TextH &amp; TextI\\  B &amp; TextJ &amp; TextK &amp; TextL &amp; TextM\\  C &amp; \multirow{2}*{TextF} &amp; TextG &amp; TextH &amp; TextI\\  \cline{3-3}  &amp; TextJ &amp; TextK \\ \hline \end{tabular} \end{center}   I was trying something like this.. I'm starting to have problems as I'm trying to multirow within a multirow? I'm not sure of the process here. I would like TextG to be split into 2 and TextH and TextI to be the cells which are split in 3 but not sure how to go about it. Will then TextJ and TextK be the contents of the split TextG cell?
79470
\usepackage{pgfplots} \usepackage{amsmath} \include{macros/style} \include{macros/use_packages} \usepackage{indentfirst} \usepackage{graphicx} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage{tikz} \usepackage{array,booktabs,ragged2e} \usepackage{listings} \usepackage{color} \section{Results} \pgfplotstableread[row sep=\\,col sep=&amp;]{ interval &amp; carT &amp; carD &amp; carC &amp; carG\\ 10 Hz     &amp; 62680  &amp; 125130 &amp; 10000 &amp; 100000\\ OSC     &amp; 62680  &amp; 125130 &amp; 100000 &amp; 100000\\ Adaptive     &amp; 62680  &amp; 125130 &amp; 1000000 &amp; 1000000\\ }\mydata  \begin{tikzpicture} \hspace{-2cm} \begin{axis}[         ybar,         bar width=17pt,         x=7cm,         ybar=1pt,         width=1\textwidth,         height=.5\textwidth,         legend style={at={(0.5,1)},             anchor=north,legend columns=-1},         symbolic x coords={10 Hz, OSC, Adaptive},         xtick=data,         nodes near coords,         nodes near coords align={horizontal},         ymin=0,ymax=400000,         ylabel={Number of Packets Sent},     ]     \addplot table[x=interval,y=carT]{\mydata};     \addplot table[x=interval,y=carD]{\mydata};     \addplot table[x=interval,y=carC]{\mydata};     \addplot table[x=interval,y=carG]{\mydata};     \legend{Six Lanes, 12 Lanes, E.C. Row, i75} \end{axis} \end{tikzpicture}
12179
Is it possible to create a table like this one?    The usual structure of tables I use looks like this:  \begin{table}[H]     \begin{adjustbox}{width=\textwidth,center}     % \begin{adjustbox}{center}         \begin{tabular}{lll}             \hline             \multicolumn{1}{l}{\head{XXX}} &amp; \multicolumn{1}{l}{\head{XXX}} &amp; \multicolumn{1}{l}{\head{XXX}} \\             \hline             \ttfamily xxx &amp; \ttfamily xxx &amp; \ttfamily xxx \\             \hline         \end{tabular}     \end{adjustbox}     \vspace{ - 05 mm}     \caption{xxx}     \label{tab:xxx} \end{table}
121259
I have the following table:  \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centerline {image}  &amp;    \multicolumn{2}{c|}{ABC} &amp; \multicolumn{2}{c|}{DEF} \\ \hline  &amp; \centering A&amp;\centering B&amp;\centering C&amp;\centering D  \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \end{tabular}   When I try centering D, I have a problem in the shape of the table. Why is that? How can I center it appropriately?  Thanks.
50768
I can't find a way to vertically center a single line within a table cell.  Take a look at this screenshoot:    I'd like to vertically center the text within the bottom right cell and I just can't find a way to do it. I tried \usepackage{array} but I couldn't figure out how to apply the \centering\arraybackslash, which seems to align things vertically within cells, just to this single cell.  (I'm also not sure why the right border is missing for this cell.)  Here is the LaTeX code that generates this table:  \documentclass{article}  \usepackage[left=1cm,top=1cm,right=1cm,bottom=1cm,nohead,nofoot]{geometry}  \usepackage[pdftex]{hyperref} \usepackage{verbatim} \usepackage{listings} \usepackage{array}  \hypersetup{colorlinks}  \lstset{basicstyle=\ttfamily}  \pagestyle{empty}  % -----------------------------------------------------------------------  \begin{document}  \begin{tabular}{|p{5.5cm}|p{12.2cm}|} \hline \large\textbf{Redirection} &amp; \large\textbf{Description} \\ \hline \verb|&gt; file| &amp; Redirect standard output (stdout) to a file. \\ \hline \verb|1&gt; file| &amp; Same as \verb|&gt; file|. \verb|1| is the default file descriptor for stdout. \\  \hline \verb|2&gt; file| &amp; Redirect standard error (stderr) to a file. \verb|2| is the default file descriptor for stderr. \\ \hline \verb|&gt;&gt; file| &amp; Append stdout to a file. \\ \hline \verb|2&gt;&gt; file| &amp; Append stderr to a file. \\ \hline \verb|&amp;&gt; file| &amp; Redirect stdout and stderr to a file. \\ \hline \verb|&gt;file 2&gt;&amp;1| &amp; Another way to redirect both stdout and stderr to a file. This \textbf{is not} the same as \verb|2&gt;&amp;1 &gt;file|. \textbf{Redirection order matters!} \\ \hline \verb|&gt; /dev/null| &amp; Discard stdout. \\ \hline \verb|2&gt; /dev/null| &amp; Discard stderr. \\ \hline \verb|&amp;&gt; /dev/null| &amp; Discard stdout and stderr. \\ \hline \verb|&lt; file| &amp; Redirect the contents of the file to the stdin. \\ \hline \verb|&lt;&lt; EOL| \\  \verb|foo| \\ \verb|bar| \\ \verb|baz| \\ \verb|EOL| &amp; Redirect a bunch of lines to the stdin. \\ \hline \end{tabular}  \end{document}
3427
When combining multirow and multicolumn in the same cell of a table I am getting extra vertical lines:  \documentclass[plain]{article} \usepackage{multirow} \pagestyle{empty}  \begin{document}  \begin{tabular}{|l|l|l|l|}\hline   \multirow{10}{*}{numeric literals} &amp; \multirow{5}{*}{integers} &amp; in decimal &amp; \verb|8743| \\ \cline{3-4}   &amp; &amp; \multirow{2}{*}{in octal} &amp; \verb|0o7464| \\ \cline{4-4}   &amp; &amp; &amp; \verb|0O103| \\ \cline{3-4}   &amp; &amp; \multirow{2}{*}{in hexadecimal} &amp; \verb|0x5A0FF| \\ \cline{4-4}   &amp; &amp; &amp; \verb|0xE0F2| \\ \cline{2-4}   &amp; \multirow{5}{*}{fractionals} &amp; \multirow{5}{*}{in decimal} &amp; \verb|140.58| \\ \cline{4-4}   &amp; &amp; &amp; \verb|8.04e7| \\ \cline{4-4}   &amp; &amp; &amp; \verb|0.347E+12| \\ \cline{4-4}   &amp; &amp; &amp; \verb|5.47E-12| \\ \cline{4-4}   &amp; &amp; &amp; \verb|47e22| \\ \cline{1-4}   \multicolumn{3}{|l|}{\multirow{3}{*}{char literals}} &amp; \verb|'H'| \\ \cline{4-4}   &amp; &amp; &amp; \verb|'\n'| \\ \cline{4-4}   &amp; &amp; &amp; \verb|'\x65'| \\ \cline{1-4}   \multicolumn{3}{|l|}{\multirow{2}{*}{string literals}} &amp; \verb|"bom dia"| \\ \cline{4-4}   &amp; &amp; &amp; \verb|"ouro preto\nmg"| \\ \cline{1-4} \end{tabular}  \end{document}     Notice the vertical lines in the char literals and string literals cells (which should span three columns). How can they be avoided?
6125
I'm trying to typeset a table that would have a header in the first row (I'm not looking for a different/better solution to adding a header, but for a fix to this solution. Thanks). I want to achieve this by having a multicolumn cell spanning all the columns of the first row. The problem is that if the text is too long, the column widths are uneven, with the last column accumulating excess width. I would expect all of the columns to be of approximately the same width (although I cannot find a decent source that would say they should), given the fact that all the text in the second row is of approximately the same width.  I find this behaviour quite puzzling and have no idea what the cause could be. I know I could perhaps remedy this by manually setting the column widths, but am curious as to how to fix this without doing that (I do not need or indeed want the columns to be of the same width, but roughly proportional to the length of their content), preferably but not necessarily by using the tabular environment only (some other conflict with the document class I am using).   What is it that I'm doing or assuming wrong? And why?  MWE:  \documentclass{article} \begin{document}  \begin{tabular}{ccccc} \multicolumn{5}{c}{This is a piece of text. The longer it is, the longer the last column.} \\  1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 \\ \hline \end{tabular}  \end{document}   Resulting table. Notice how the last column of the second row accumulates excess width.
57437
I'm finishing my Msc. Thesis and I'm facing the last problems with some tabular, I'm not able to align this one.  \documentclass[12pt,a4paper,oneside,openright]{book} \usepackage{adjustbox} \usepackage{array} \usepackage{dcolumn} \usepackage{amsmath,amssymb}    \usepackage{amsthm} \usepackage{booktabs}  \usepackage{caption}   \usepackage{multirow} \usepackage{siunitx}  \usepackage{tabularx} \usepackage{ltablex} \usepackage{makecell}  \begin{document} \begin{table} \centering \caption{Analisi variabile tasso di interesse\label{tab:stat:tasso}} \begin{tabular}{p{3cm}p{3cm}} \toprule Data di segnalazione &amp; \makecell[ccc]{\% \\ Tasso di interesse\\ medio} \\ \toprule 2014h1 &amp; 3.59\\ 2014h2 &amp; 3.44 \\ 2015h1 &amp; 3.37 \\ 2015h2 &amp; 3.82 \\ 2016h1 &amp; 3.68 \\ \bottomrule Media &amp; 3.58 \\ \end{tabular}% \end{table}% \end{document}