I am new to LaTex and I am making my CV. I want to add a table for my education section but it does not look good.  this is not at all appealing to the eye. Here's the code, please suggest some changes. Thank you. \begin{center}  \begin{tabular} { | m {3.3 cm} | m {8.2 cm} | m {3.3 cm} | m {2.2 cm} | } \hline \textbf{Serial No.} &amp; \textbf{Institute} &amp; \textbf{Year} &amp; \textbf{CPI/\%} \\ \hline 1 &amp; ABC Univ &amp; 2011-2015 &amp; 10.0\\ 2 &amp; BCD High School  &amp; 2011 &amp; 91.85/100\\ \hline \end{tabular} \end{center}
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?
88341
I want to use a table in my answer. e.g  |-------------|----------------| | ShortCut    | Description    | |-------------|----------------|  I have posted an answer , which requires this kind of formatting.   Is it possible to have such formatting in stackoverflow Questions &amp; answers ?    If yes, How ? If no, why ?   Edit : I tried to use following code directly in editor of SO. But it didn't work for me.  &lt;table&gt; &lt;tr&gt; &lt;td&gt;hello&lt;/td&gt; &lt;td&gt;hello2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;hello3&lt;/td&gt; &lt;td&gt;hello4&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
96328
I have a LaTeX table generated like this,   \begin{table}[ht] \begin{center} \begin{tabular}{rrrrrrr} \hline &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 \\  \hline 1 &amp; 181.21 &amp; 169.01 &amp; 130.03 &amp; 135.93 &amp; 142.31 &amp; 108.11 \\  2 &amp; 106.80 &amp; 130.71 &amp; 186.43 &amp; 126.46 &amp; 167.28 &amp; 137.91 \\  3 &amp; 162.69 &amp; 198.98 &amp; 188.33 &amp; 184.30 &amp; 147.02 &amp; 197.38 \\  4 &amp; 132.42 &amp; 150.50 &amp; 148.69 &amp; 134.31 &amp; 129.52 &amp; 172.72 \\  \hline \end{tabular} \end{center} \end{table}   but when i compile it in MiKTeX I am getting the following error   ! Undefined control sequence. l.1 \begin           {table}[ht] ?  Process interrupted by user   I want a table generated from this i am compiling under pdfTeX. I am using LaTeX for first time, can anyone please give a suggestion?
60022
I was wondering what the proper LaTeX code would be to display something like this:    You don't have to include the mathematical symbols, what is important is the structure.
60813
I'm trying to write up a table but I'm missing the vertical rows in the last few columns. Anyone have any clues as to how to fix this?   \setlength\tabcolsep{4pt}  \begin{tabular}{|l|l|l|l|l|}  \cline{2-5}   \multicolumn{1}{l|}{} &amp; Autumn &amp; Pre-requisites &amp; Spring &amp; Pre-requisites \\\hline   \multirow{4}{*}{\textbf{Year 1}} &amp; MATH187 &amp; Either a mark of at least 80 in \\ &amp; &amp; MATH151 OR (in the NSW HSC \\ &amp; &amp; Examination) Mathematics Band \\ &amp; &amp; 4; or Mathematics Ext 1. &amp; MATH188 &amp; MATH187 \\\cline{2-5}                                &amp; MATH100 &amp; None &amp; MATH123 &amp; MATH187 or MATH141 with \\ &amp; &amp; &amp; &amp; co-requisites of MATH188 \\ &amp; &amp; &amp; &amp; or MATH142 \\\cline{2-5}                               &amp; CSIT110 &amp; None &amp; STAT101 &amp; None \\\cline{2-5}                                                                       &amp; ACCY111 &amp; None &amp; ACCY112 &amp; ACCY112 \\\hline \hline       \multirow{4}{*}{\textbf{Year 2}} &amp; MATH201 &amp; One of MATH110, MATH188 or \\ &amp; &amp; MATH283, or a mark of at least \\ &amp; &amp; 75 in MATH142 or MATH162, or \\ &amp; &amp; enrolment in course code 762A. &amp; MATH202 &amp; MATH201 \\\cline{2-5}                               &amp; MATH203 &amp; One of MATH101, MATH188 or \\ &amp; &amp; MATH283 or enrolment in course \\ &amp; &amp; code 762A. &amp; MATH204 &amp; MATH201 \\\cline{2-5}                               &amp; MATH222 &amp; One of MATH101, MATH188 or \\ &amp; &amp; enrolment in course code 762A &amp; MATH212 &amp; One of MATH101, MATH188, \\ &amp; &amp; &amp; &amp; MATH283 or enrolment in \\ &amp; &amp; &amp; &amp; course code 762A \\\cline{2-5}                                   &amp; STAT231 &amp; MATH188 or enrolment in \\ &amp; &amp; course code 762A. &amp; STAT232 &amp; STAT231 \\\cline{2-5}  \hline \end{tabular}   The output I get for the code above is:
52429
Manually hacking tables in LaTeX is one of the less funny things when preparing a document. Naturally, there are quite a few tools that promise to simplify this. In fact, I have somewhat lost track of all the tools available, and I'd like to gather your valuable experience into one big post. Some of the tools are mentioned in , but I feel there's much more around.  I'd suggest that somebody starts an overview with an alphabetic list (so that I can accept this answer and it stays on top), and that everyone replies with a "community wiki" entry, one reply per tool, and inserts the tool into the list.  Personally, I use Excel2LaTeX, but I'm unhappy with having to fire up Windows in order to generate the LaTeX code. I'm thinking of a rewrite as a standalone Python tool using the xlrd library, but I'm not too inclined to reinvent the wheel.
7662
I am making a centered table but want the headings in the far left column to be left-aligned instead of centred.  Preamble:   \documentclass[11pt]{article} \usepackage{indentfirst} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption}  Table code: \begin{table}[ht] \caption{Regression standard errors} % title of Table \centering % used for centering table \begin{tabular}{c c c c c} % centered columns (4 columns) \hline\hline %inserts double horizontal lines Confidence Interval &amp; N=10 &amp; N=30  &amp; N=100 &amp; N=500 \\ [0.5ex] % inserts table  %heading \hline % inserts single horizontal line Asymptotic &amp; \% &amp; \% &amp; \% &amp; \% \\ Efron &amp; \% &amp; \% &amp; \% &amp; \% \\ Hall &amp; \% &amp; \% &amp; \% &amp; \%   \\ Percentile-t &amp; \% &amp; \% &amp; \% &amp; \% \\ Symmetric percentile-t &amp; \% &amp; \% &amp; \% &amp; \% \\ [1ex] % [1ex] adds vertical space \hline %inserts single line \end{tabular} \label{table:nonlin} % is used to refer this table in the text \end{table}
118164
I defined a table in LaTeX : \begin{tabular}....\end{tabular}.  Now i want to export that table to an image (PNG or something}.  It is possible? How can i do that?
64497
I'm writing a technical documentation and I want to explain step-by-step how to go through various menus.  For example I used to write Open with &gt; VLC media player.  That's how it looks in Windows 8:     What I want in Latex should looks similar to this: light grey box, dark grey border and black windows-like font.    I've seen , suggesting the package  - but it looks very old fashioned - are there any more modern approaches?
49533
I am trying to produce a basic color table as shown below  \documentclass{article}  \usepackage{booktabs}  \usepackage[dvipsnames*,svgnames]{xcolor}  \usepackage{colortbl}  \usepackage{array}  \begin{document}  \begin{table} \centering \setlength{\aboverulesep}{0pt} \setlength{\belowrulesep}{0pt} \setlength{\extrarowheight}{.75ex} \begin{tabular}{|&gt;{\columncolor{LightSteelBlue}}c| c | c | c|} \toprule  \rowcolor{LightSteelBlue}  &amp; {Mann} &amp; {Kvinne} &amp; {Totalt} \\   \rowcolor{LightSteelBlue}  &amp;        &amp;          &amp;        \\ \midrule  \O nsker        &amp;      &amp;        &amp;        \\   Ballbinge       &amp;      &amp;        &amp;        \\ \midrule  \O nsker ikke   &amp;      &amp;        &amp;        \\   Ballbinge       &amp;      &amp;        &amp;        \\ \midrule  Totalt          &amp;      &amp;        &amp;        \\                   &amp;      &amp;        &amp;        \\   \bottomrule \end{tabular} \end{table} \end{document}   Now I wanted to center the text in the first row, and column, inside their boxes. My first thought was to use \multirows, alas this produces some very ugly results. The text is hidden behind the colors.  What is the proper way to create the table above, with centered text?  (Any other comments about how to improve the looks of the table are also welcome)
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.
19162
I have a table which has quite a lot of text but want to keep it on a portrait page. I am using the tabularx environment and managed to get all I want into the columns, but now the spacing between the words is super ugly. I'd rater define the orientation of my text in the table in each column, than having it justified. How can I change that?  I am pretty new to latex and I still struggle a lot. I went through some similar questions already, but I only make it worse trying to fix my problem.   \documentclass[12pt]{article} \usepackage[english]{babel} \usepackage{textcomp} \usepackage{graphicx} \usepackage{chngcntr} \counterwithin{figure}{section} \usepackage[font=small,labelfont=bf]{caption} \usepackage{tabularx}  \begin{document}  \begin{table}[htb] \footnotesize \begin{tabularx}{\textwidth}{&gt;{\hsize=.4\hsize}X&gt;{\hsize=.7\hsize}X&gt;{\hsize=1.3\hsize}X&gt;{\hsize=1.3\hsize}X&gt;{\hsize=1.3\hsize}X} \hline \hline \textbf{WHO grade} &amp; \textbf{Type} &amp; \textbf{Description} &amp; \textbf{Treatment} &amp; \textbf{Outcome} \\ \hline \hline I &amp; Pilocytic astrocytoma &amp; low proliferative potential, not diffusive &amp; surgical resection &amp; not associated with recurrence after complete resection\\ II &amp; Diffuse glioma &amp; infiltrative, low mitotic activity, well differentiated &amp; surgical resection, adjuvant therapy &amp; median survival $&gt;$10 years, often recurrence as high-grade tumour\\ III &amp; Anaplastic Astrocytoma &amp; mitotically active, anaplastic histology and infiltrative capacity &amp; surgical resection, aggressive adjuvant therapy &amp; median survival 2-3 years, recurrence as grade IV\\ IV &amp; GBM &amp; mitotically active, anaplastic histology, highly infiltrative, necrisis, angiogenesis &amp; surgical resection, aggressive adjuvant therapy &amp; associated with rapid progression, median survival 14 month\\ \hline \hline \end{tabularx} \caption{WHO Glioma Grades} \label{table:glioma types} \end{table}  \end{document}   Looks like this:
45652
I would like to create the following table bases on the answer of @Zarko  since i use the same code for another kind of table     \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[table]{xcolor} \usepackage{tabularx} \usepackage{enumitem} \usepackage{etoolbox} \AtBeginEnvironment{center}{%     \setlist[itemize,1]{nosep,                         topsep     = 0pt,                         partopsep  = 0pt,                         leftmargin = *,                         label      = \textendash,                         before     = \vspace{-0.6\baselineskip},                         after      = \vspace{-\baselineskip}                         }     \setlist[itemize]{  nosep,                         leftmargin=*,                         label = $\bullet$                       } }  \begin{document}     \begin{center} \bfseries \begin{tabularx}{\linewidth}{ | l | X |X| }     \hline \multicolumn{2}{|&gt;{\centering\arraybackslash}%                  p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth\relax}|}{\cellcolor{gray!30}     Very long text here and centered     Very long text here and centered     Very long text here and centered}    \\     \hline \multicolumn{3}{c}{}                    \\     \hline Year &amp;   Cycle &amp; Issues     \\     \hline 2018-2019   &amp; High School &amp; very \\     \hline \end{tabularx}     \end{center} \end{document}
116669
Is there a way to add the usage of a table/reference in the caption of the reference/table in LaTeX?  For example:  \begin{table}     \begin{tabular}{ll}     \textbf{Name} &amp; \textbf{Description} \\         Foo &amp; bar \\         Foo &amp; bar     \end{tabular}     \caption{Nice Table. Used on pages [2,3,4].}     \label{tab:table} \end{table}   I would like the "Used on pages[2,3,4]." to appear automatically and linked to the correct reference, to all the locations in the document that use \ref{tab:table}.  Anyone knows a package that takes care of this?
38203
In a document I'm writing, I'm using the familiar  option for my floating tables, and I  them. I'd like to avoid repeating that every time I'm creating a table. I assume it's easy to add something in my preamble that makes sure that these two options are used every time I begin a new table environment?  \documentclass{article} \begin{document} \begin{table}[hbt] \centering \begin{tabular}{*3{l}} 1 &amp; 2 &amp; 3\\ a &amp; b &amp; c\\ \end{tabular} \end{table} \end{document}
91144
I have been trying to get the appendix for my thesis done. I've read a lot about it and as always you can chose between a fiddly way and a magic package that doas the job to solve a problem (I usually prefer a magic package). Unfortunately both approaches didn't work out, so here is how far I got.  Four requirements  This is what my appendix should look like for a document with class 'article', there are four requirements:  Sections should look like this:  Appendix A    Title1  Appendix B    Title2   They should appear in the same way in the TOC:  Appendix A    Title1                    56  Appendix B    Title2                    88   \ref{app:foo} should be able to return the letter of the corresponding appendix.  Tables and Figures should be labeled as Table A1. or Figure A1.  Fiddly approach  \documentclass{article}  \renewcommand\appendix{\par   \setcounter{section}{0}   \setcounter{subsection}{0}   \setcounter{figure}{0}   \setcounter{table}{0}   \renewcommand\thesection{Appendix \Alph{section}}   \renewcommand\thefigure{\Alph{section}\arabic{figure}}   \renewcommand\thetable{\Alph{section}\arabic{table}} }  \begin{document} \tableofcontents  \section{Dolor sit amet} Have a look at \ref{app:foobar}  \appendix \section{foo} \label{app:foobar}  \begin{table}[h] \caption{foo} \begin{tabular}{cc} \textbf{ a } &amp; \textbf{ b }\\ 1 &amp; 3 \\ 2 &amp; 4\\ \end{tabular} \end{table}  \end{document}   It worked out pretty good. The problem is that in the TOC the appendix title "foo" gets written onto "Appendix A". Is there a way to adjust the position of the title in the TOC?  Magic package 'appendix'  The solution I found  unfortunately applies only to the documentclass 'report' where chapters are used. But my document has the class 'article' and no chapters whatsoever. I also don't like it that the appendix titles are not in the same lines as "Appendix A" and in table labels there is a dot between the section and table number "Table A.1.".  \documentclass{report} \usepackage[titletoc,toc]{appendix}  \begin{document} \tableofcontents  \section{Dolor sit amet} Have a look at \ref{app:foobar}  \begin{appendices}   \chapter{Consectetur adipiscing elit} \label{app:foobar}     \begin{table}[h]     \caption{foo}     \begin{tabular}{cc}     \textbf{ a } &amp; \textbf{ b }\\     1 &amp; 3 \\     2 &amp; 4\\     \end{tabular}     \end{table}   \chapter{Mauris euismod} \end{appendices} \end{document}    Is there a proper way using the appendix package? I played around with the toc, title and titletoc arguments for the package. But it didn't do what it said in the manual.  It would great if someone could help me, no matter on which approach!  Update  Thank you very much for your help! The first comment from Alan Munn reassuring me that the appendix package should work as expected helped me to find the error. This is the erroneous code:  \documentclass[a4paper,12pt]{article}  %appendix \usepackage[title,titletoc,toc]{appendix}  %format paragraphs \usepackage{titlesec} \titleformat{\paragraph}[runin]{\normalfont\normalsize\itshape}{\theparagraph}{}{}[.] %format paragraph italic and ser a period after it \titlespacing{\paragraph}{0pt}{0pt}{*1} %remove spacing and add one characterspace after paragraph  \begin{document} \tableofcontents  \section{Method} (The entire results are detailed in Appendix \ref{app:bar}).     \begin{appendices} \section{foo} \label{app:foo} asd \section{bar} \label{app:bar} \end{appendices} \end{document}   The three lines which format paragraphs cause the appendices to fail in the toc. If taken out, everything works fine. But what about my paragraphs then? Do I have to pose another question for that? ;)
42900
I am new to LaTeX. I am writing a CV using the moderncv package with style banking. I want to add a photo. After I run the compile command it exits normally but the photo doesn't appear on the page.   My code is following:   \documentclass[11pt,a4paper,sans]{moderncv} \moderncvstyle{banking}  \moderncvcolor{blue}  \usepackage[utf8]{inputenc} \usepackage[scale=0.8]{geometry} \usepackage{import} \usepackage{booktabs} \usepackage{xcolor} \usepackage{tabularx}  \name{Name}{Last Name} % My name is quite long, can it be the problem? \title{Resume} \address{Address}    \phone[mobile]{my_number}     \email{my_e-mail}   \photo[64pt][0pt]{name_of_the_phot}    \setlength\tabcolsep{10pt} \begin{document}  \makecvtitle     \end{document}   Any help how to add photo and change its position afterwards? I want it to appear on the right or left side.  Thanks in advance.