How to center text vertically in this table?  \begin{center}   \begin{tabularx}{\linewidth}{ | c | X | X | }     \hline       \textbf{Date} &amp; \textbf{Name} &amp; \textbf{Sign} \\     \hline       31.03.2013 &amp; &amp; \\     \hline   \end{tabularx} \end{center}   Changing package is not a solution for me. How to do it in tabularx?
98559
I'd like to create a new column type which works exactly like a X column from tabularx but that also has the text vertically centered. I tried with the newcolumntype command but I can't figure out where to put the second column type? Example:  \newcolumntype{n}{&gt;{\centering\arraybackslash}X}   Where should I put the mto specify that the cells content should be vertically centered?
100425
When I put X in column specifier, how can I define column formatting? How can I get center alignment? Currently I am putting \centering, but that is not a proper solution.   This is my code:  \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{patterns} \usepackage{booktabs,tabularx} \usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry   \begin{document}  \begin{table}[t] \caption{Case studies} \centering  \begin{tabularx}{\textwidth}{p{4cm}*{5}{X}}     \toprule \centering Nature of unreliability &amp; \centering Sender SST &amp; \centering Receiver SST &amp; \centering 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}    \end{document}
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:
122828
I know using turn command and a sample code like this:  \usepackage{rotating}  \begin{turn}{90} Supervised Learning \end{turn}}   we can rotate a text inside a cell, however, I couldn't find a way to vertically center this rotated text. Any suggestions is appreciated.  Here is the sample MWE:  \begin{table}[]     \centering     \begin{tabular}{|&gt;{\centering\arraybackslash}m{0.5cm}|c|&gt;{\centering\arraybackslash}m{8cm}|}         \hline         \multicolumn{2}{|c|}{Classification} &amp; References \\ \hline         %\multirow{2}{*}{{\begin{turn}{90}Supervised Learning\end{turn}}}            \multirow{2}{*}{\rotatebox[origin=c]{90}{Supervised Learning}}  \end{tabular}     \caption{A Classification}     \label{tab:Machine_Learning_models} \end{table}
100054
How to adapt this table to break across page boundaries?  Original question here:      \documentclass{article}     \usepackage{tabularx}     \usepackage{amsmath}     \usepackage[table]{xcolor}     \usepackage{tabularx, multirow, makecell, rotating} %     \usepackage{enumitem}          \begin{document}         \begin{center}     \bfseries \settowidth\rotheadsize{List of Abbreviation/accronym} \begin{tabularx}{\linewidth}{|c|&gt;{\centering\arraybackslash}X|}     \hline \cellcolor{gray!30} Abbreviation &amp; \cellcolor{gray!30} Explanation     \\     \hline \multirow[b]{2}{*}{USA}                &amp; \cellcolor{blue!30}  United state of america  \rule[-1em]{0pt}{2.5em} \\     \cline{2-2} %   &amp;  %   \rule[-1em]{0pt}{2.5em} \\ %    \cline{2-2}     &amp;    \rule[-1em]{0pt}{2.5em} \\     \hline         \multirow[b]{2}{*}{NY}                &amp;  \cellcolor{blue!30} New york   \rule[-1em]{0pt}{2.5em} \\     \cline{2-2} %   &amp;  %   \rule[-1em]{0pt}{2.5em} \\ %    \cline{2-2}     &amp;     \rule[-1em]{0pt}{2.5em} \\     \hline \end{tabularx}     \end{center}     \end{document}
91054
how can I align some text in any text area vertically? so I can align a label vertically and Horizontally in any text area, as if i align the text in a table cell.
58636
Note: My hope is that this can become a general resource for "use a list instead" comments. If you have suggestions for improvement, please let me know.    I often see comments such as      This layout should be typeset using a list, not a tabular.   and (my favorite, paraphrasing because I cannot find the exact quotation right now)     If every tabularx with an lX preamble was a list instead, the world would be a better place.   This is all well and good, and I can see the benefits (chiefly: page breaking mid-"row" and without specialty table packages).  A description environment gets close, but it has a fixed left indent that does not depend on the longest item name.  The  at  shows a way to do this using the environ and enumitem packages.    What other methods do you use to achieve this layout? I'd like to avoid manually specifying the longest label (its width, essentially). This is something that tabularx does not require, and I don't want it to be required in the solution to this problem either, if I can avoid it.    Alternatively, what other layouts are recommended for this type of content? Examples of common document elements for which tabularx is used include nomenclature lists and other lists of notation.    MWE  \documentclass{article} \usepackage{tabularx} \usepackage{lipsum} % just for blind texts \newenvironment{mylist} % what else goes here?   {\trivlist}   {\endtrivlist}  \begin{document}  \section{trivlist version} \begin{mylist}   \item[Text 2] \lipsum*[2] \end{mylist}  \section{tabularx version} \noindent \begin{tabularx}{\textwidth}{@{}lX@{}}   Text 2 &amp; \lipsum*[2] \end{tabularx}  \section{description version} \begin{description}   \item[Text 2] \lipsum*[2] \end{description}  \end{document}
47460
I want to add a box in a tabularx table that would frame several cells vertically. There is this post that shows how to frame cells horizontally (), but I cannot figure out how to do to have the box extend over several rows. Here is what I would roughly like to get (but with a nice box):  Column 1 &amp; Column 2 &amp; Column 3                       +-----+ bla      &amp; bla      &amp; |bla  |                       |     | bla      &amp; bla      &amp; |bla  |                       +-----+   Any idea of how I could do that?  Edit: the solutions proposed below are very nice. But they are compatible with the tabular environment only, it seems, and not with tabularx and booktabs. Below is the code I have used. Does anyone have an idea of how to extend these solutions to the tabularx style? If not, then I will just rewrite all my tables using the simple tabular style.        \documentclass{article}    \usepackage{tabularx, booktabs}    \usepackage{tikz}    \usetikzlibrary{calc}     \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}    \newcommand{\DrawBox}[1][]{%         \tikz[overlay,remember picture]{         \draw[black,#1]            ($(left)+(-0.5em,2.0ex)$) rectangle            ($(right)+(0.75em,-0.75ex)$);}           }     \begin{document}    \begin{table}[H]    \centering     \begin{tabularx}{0.3\textwidth}{Y*{4}{c}}         \toprule          &amp; Masc  &amp; Fem &amp; Neut\\          \midrule  \cline{4-4}         Nom &amp; hic &amp; haec &amp; \multicolumn{1}{|c|}{hoc} \\          Acc &amp; hunc &amp; hanc &amp; \multicolumn{1}{|c|}{hoc} \\ \cline{4-4}         \bottomrule      \end{tabularx}     \end{table}      \begin{table}[H]    \centering     \begin{tabularx}{0.3\textwidth}{Y*{4}{c}}         \toprule          &amp; Masc  &amp; Fem &amp; Neut\\          \midrule           Nom &amp; hic &amp; haec &amp; \tikzmark{left}hoc \\          Acc &amp; hunc &amp; hanc &amp; hoc\tikzmark{right} \\          \bottomrule      \end{tabularx}       \end{table}     \end{document}
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:
116133
I have this table definition as part of a invoice  \begin{tabularx}{\textwidth}[ht]{lXrr}%   It worked fine for years until I have a very short word in the X column for the first time. Now my table is very small in width and centered horizontally on the page.  In my expectation the X column should fill up all space until the width of the table reaches the width of the page except the margins.  I have read about workarounds specifying something like 1.2\textwidth, but I don't like that, because the table is a template included via \include, so it would affect all my invoices.  I also tried \linewidth, \hsize and \columnwidth, but everything results in the same layout.  Is there a way to make the only X column expand so that it uses all available space?    Complete included table definition (Rechnungstabelle.tex):  \newcommand{\Rechnungstabelle}[4]{% vielen Dank für Ihren Auftrag. \noindent \begin{tabularx}{\textwidth}[ht]{lXrr}% \toprule% \bf{Anzahl} &amp; \bf{Bezeichnung} &amp; \bf{Einzelpreis} &amp; \bf{Gesamtpreis} \\% \midrule% #1% \bottomrule% &amp; \bf{Rechnungsbetrag}  &amp; &amp; \bf{\EUR{#2}} \\% \ifthenelse{\equal{#3}{}}{}{&amp; Enthaltene MwSt. 19\% &amp; &amp; \EUR{#3} \\}% \ifthenelse{\equal{#4}{}}{}{&amp; * Enthaltene MwSt. 7\% &amp; &amp; \EUR{#4} \\}% \end{tabularx}% }   Changing the table header row to  \bf{Anzahl} &amp; \bf{Bezeichnung} \hspace{\textwidth} &amp; \bf{Einzelpreis} &amp; \bf{Gesamtpreis} \\%   is a workaround, but I don't think that would be good TeX style.  Minimum example for reproducing:  \documentclass[ fontsize=12pt,                  paper=a4,                 foldmarks=TBMPL,                 fromalign=center,                 ngerman                 ]{scrlttr2} \usepackage{babel} \usepackage[utf8]{inputenx} \usepackage[right]{eurosym} \usepackage{tabularx} \usepackage{ltablex} \usepackage{booktabs} \usepackage{ifthen}  \input{Rechnungstabelle} \begin{document} \begin{letter}  \Rechnungstabelle{     1,0 h &amp; Do something &amp; \EUR{99,00} &amp; \EUR{99,00} \\      }     {99,00}     {}{} \end{letter} \end{document}
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}
115636
I am quite new to TeX. I want that each line in the following equation be centered, but I cannot find how to do it.  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} a &amp; = \frac{M_{20}}{M_{00}} - x^{2}_{c}, \;\;\; b = 2(\frac{M_{11}}{M_{00}} - x_{c}y_{c}), \;\;\; c = \frac{M_{02}}{M_{00}} - y^{2}_{c}, \\ &amp;\quad x_{c} = \frac{M_{10}}{M_{00}}, \;\;\; y_{c} = \frac{M_{01}}{M_{00}}, \\ &amp;\quad M_{ij} = \displaystyle\sum\limits_{x} \displaystyle\sum\limits_{y} x^i y^j I(x,y) \end{split} \end{equation} \end{document}   Also, it would be awesome if I could write "and" after the first line ;)  Thanks in advance
76966
How can I change the color of the lines (the frame) in a tabular environment? In the following MWE:  \begin{tabular}{c|c|c} a&amp;b&amp;c \\ \hline d&amp;e&amp;f \\ \hline g&amp;h&amp;i \end{tabular}   I would like the horizontal and vertical lines of the table to have, say a blue color.
90147
Is there a (portable) way to rotate text in a HTML table cell by 90°?  (I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)
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?
112136
This picture is a part of a table i am using, the terms subcases are vertically written but i cant center them vertically also in the next columns terms like A, B, etc are also not vertically centered. I made this table using tabulary package a. My code is  \begin{table}[H]  \centering  \caption{Saturation Table}  \label{tab:5}%  \begin{tabulary}{1\linewidth}{J J J J J J J J J J J J J}  \toprule  &amp; \textbf{Method} &amp; \multicolumn{1}{c}{\textbf{Parameters}} &amp; \textbf{Step 0} &amp; \textbf{Step 1} &amp; \textbf{Step 2} &amp; \textbf{Step 3} &amp; \textbf{Step 4} &amp; \textbf{Step 5} &amp; \textbf{Step 6} &amp; \textbf{Step 7} &amp; \textbf{Step 8} &amp; \textbf{Step 9} \\  \midrule  \multirow{4}[4]{*}{\begin{sideways}\textbf{Subcase A}\end{sideways}} &amp;  \multirow{2}[2]{*}{\textbf{A}} &amp; \textbf{No} &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; \textbf{6} &amp; &amp; &amp; &amp; \\[1mm]  &amp; &amp; \textbf{Maximum Saturation {(\%)}} &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 4 &amp; \textbf{5} &amp; &amp; &amp; &amp; \\  \cmidrule{2-13} &amp; \multirow{2}[2]{*}{\textbf{B}} &amp; \textbf{No} &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; \textbf{8} &amp; &amp; \\[1mm]  &amp; &amp; \textbf{Maximum Saturation {(\%)}} &amp; 6 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 9 &amp; 19 &amp; \textbf{8} &amp; &amp; \\  \bottomrule  \end{tabulary}%  \end{table}%
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}