\documentclass{article} \usepackage{} \usepackage{makecell, multirow, tabularx} \begin{document}  \begin{table}[h!] \setlength\extrarowheight{2pt} % for a ever so slightly more open "look"     \begin{tabularx}{\textwidth}{X |c |c |c |c |}     \cline{2-5}      &amp; Mean &amp; N &amp; Std. Deviation &amp; Std. Error Mean \\          \hline     Testing123 Testin123 Testing123 Testin123 &amp; 23\% &amp; 10\% &amp; 279\% &amp; 233\% \\     \hline     \end{tabularx} \caption{Testing123 Testin123Testing123 Testin123} \end{table}   Outcome:   I had added in multicolumn      \begin{table}[h!] \setlength\extrarowheight{2pt} % for a ever so slightly more open "look"     \begin{tabularx}{\textwidth}{X |c |c |c |c |}     \cline{2-5}      &amp; Mean &amp; N &amp; Std. Deviation &amp; Std. Error Mean \\          \hline     \multicolumn{1}{|c|}{Testing123 Testin123 Testing123 Testin123} &amp; 23\% &amp; 10\% &amp; 279\% &amp; 233\% \\     \hline     \end{tabularx} \caption{Testing123 Testin123Testing123 Testin123} \end{table}   Outcome:    and I wanted to make "Testing123 Testin123 Testing123 Testin123 " into 2 row.
121808
\documentclass{article} \usepackage{tabularx} \usepackage{multirow} \begin{document}  \begin{table}[h!] \setlength\extrarowheight{2pt} % for a ever so slightly more open "look"     \begin{tabularx}{\textwidth}{c X | c | c | c |}     \cline{3-5}     &amp;  &amp; \multicolumn{3}{c|}{Paired Differences} \\     \cline{3-5}      &amp; &amp; Mean &amp;  Std. Deviation &amp; Std. Error Mean \\          \hline     Pair 1 &amp; Testing 1 and Testing 2 and Testing 3 &amp; 4.20\% &amp; 44.6\% &amp; 4.54\%  \\     \hline       \end{tabularx} \caption{Testing 123} \end{table}  \end{document}   Outcome:    I cannot figure out. If I added \begin{tabularx}{\textwidth}{|c X | c | c | c |} It will not be working
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?
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?
53423
I am trying to build a table, and inside the tabularx environment I would like to have a loop, something like (here is a MWE):  \documentclass[10pt,a4paper]{article} \usepackage{tabularx} \usepackage{tikz} \newcommand{\nRows}{5} \begin{document}   \begin{tabularx}{\textwidth}{@{}&gt;{\raggedright}p{2.2cm}@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}}     \foreach \r in {1,...,\nRows}{  % https://stackoverflow.com/questions/2561791/iteration-in-latex         \textbf{column1} &amp; two &amp; three &amp; four &amp; five      } \end{tabularx}  \end{document}   This doesn't work, because the ampersands (&amp;) are causing problems. If I escape the &amp;s, then the entire line gets printed in the first column, along with the literal ampersands, kind of like:  \documentclass[10pt,a4paper]{article} \usepackage{tabularx} \usepackage{tikz} \newcommand{\nRows}{5} \begin{document}   \begin{tabularx}{\textwidth}{@{}&gt;{\raggedright}p{2.2cm}@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}}     \foreach \r in {1,...,\nRows}{  % https://stackoverflow.com/questions/2561791/iteration-in-latex         \textbf{column1} \&amp; two \&amp; three \&amp; four \&amp; five      } \end{tabularx}  \end{document}   This yields:  |column1 &amp;      | | | | | two &amp; three &amp; | | | | | four &amp; five   | | | |   Whereas what I want is:  |column 1 | two | three | four | five | |column 1 | two | three | four | five | |column 1 | two | three | four | five |   ....  Any ideas on how I can achieve this? I'm actually NOT looking to make identical rows - the rows will be different. This is just a MWE. Thanks!  Edit: I have tried implementing Herbert's answer as recommended in the comments section. It results in no output - just a blank PDF. Here is how I implemented it:  \documentclass[10pt,a4paper]{article} \usepackage{tabularx} \usepackage{tikz} \newcommand{\nRows}{5}  \makeatletter \newtoks\@tabtoks \newcommand\addtabtoks[1]{\@tabtoks\expandafter{\the\@tabtoks#1}} \newcommand*\resettabtoks{\@tabtoks{}} \newcommand*\printtabtoks{\the\@tabtoks} \makeatother  \begin{document}      \resettabtoks     \foreach \r in {1,...,\nRows}{  % https://stackoverflow.com/questions/2561791/iteration-in-latex         % \textbf{column1} \&amp; two \&amp; three \&amp; four \&amp; five          \addtabtoks{\textbf{column1} &amp; two &amp; three &amp; four &amp; five \\\hline}%     }  \begin{tabularx}{\textwidth}{@{}&gt;{\raggedright}p{2.2cm}@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}&gt;{\raggedright}X@{}} \printtabtoks \end{tabularx}  \end{document}   Any ideas on what I am doing wrong? Thanks!
45593
The code  \documentclass[a4paper]{article} \usepackage{multirow} \begin{document}  \begin{tabular}{|l|l|l|l|l|l|l|}   \hline   \multirow{2}{*}{Color Type} &amp; \multirow{2}{*}{Channels} &amp; \multicolumn{5}{c}{Bits per     channel} \\       \cline{3-7}   &amp; &amp; 1 &amp; 2 &amp; 4 &amp; 8 &amp; 16 \\       \hline \end{tabular}  \end{document}   Results in the table    How may I fix this code so that a vertical line is also added after "Bits per channel"?
32670
Here is a simple table.  I want to merge 4 cells. I want to combine the three "this" cells area in this table. I thought I have to use multirow and multicolum at same time. However, I could not find how to use it.  If possible, could you post the modified LaTeX source code?     My LaTeX code:  \documentclass{article} \usepackage{multirow}% http://ctan.org/pkg/multirow \usepackage{hhline}% http://ctan.org/pkg/hhline \begin{document}  \begin{table}[ph] \begin{center} \begin{tabular}{c|c|c|c|c} \hline \multirow{2}{*}{Raaa (k)} &amp; \multicolumn{4}{c}{C ()} \\ \hhline{~----}  &amp; 3.3 &amp; 2.5 &amp; 1 &amp; 0.5 \\ \hline \multirow{2}{*}{Raaa (k)} &amp; \multirow{2}{*}{this} &amp; this &amp; 0.5 &amp; 0.6\\ \hhline{~~~--}            &amp;                       &amp; this &amp; 0.7 &amp; 1.2 \\ \hline \end{tabular} \caption{R, C ripple size} \label{T:peak} \end{center} \end{table} \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}
75503
The table is too wide, and I want to make it narrower by wrapping the Second under the First, how should I achieve this?  The latex code looks like this currently:  \begin{table*}[htbp]    \centering   \caption{Add caption}     \begin{tabular}{c|ccccc}     \hline     \textbf{\#} &amp; \textbf{Violations} &amp; \textbf{First Second} &amp; \textbf{First Second} &amp; \textbf{First Second} &amp; \textbf{First Second} \bigstrut\\     \hline     1   &amp; 0   &amp; 91  &amp; 101 &amp; 507 &amp; 1973.54 \bigstrut[t]\\     2   &amp; 0   &amp; 102 &amp; 92  &amp; 472 &amp; 1874.65 \\     3   &amp; 0   &amp; 104 &amp; 92  &amp; 459 &amp; 1856.21 \\     4   &amp; 0   &amp; 108 &amp; 100 &amp; 407 &amp; 1790.56 \\     5   &amp; 0   &amp; 112 &amp; 77  &amp; 511 &amp; 1723.66 \\     $\ldots$   &amp; $\ldots$  &amp; $\ldots$  &amp; $\ldots$   &amp; $\ldots$   &amp; $\ldots$ \\     \hline     \end{tabular}%   \label{tab:addlabel}% \end{table*}%
75106
Why isn't the table adjusting the text to make line breaks when necessary? Can I make them manually? What could be done to fix these margins? Edit: MWE below: \documentclass[a4paper,12pt,spanish]{article} \usepackage{multirow} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage[spanish]{babel} \usepackage{graphicx} \begin{document} \begin{center} \begin{tabular}{|r|ccccc|} \hline    &amp; Descripción &amp; Narración &amp; Diálogo &amp; Exposición &amp; Argumentación \\ \hline   Técnico-científico &amp;  &amp;  &amp;  &amp; Habitual &amp; \\   Jurídico-administrativo &amp;  &amp;  &amp;  &amp;  &amp; \\   Humanístico &amp;  &amp;  &amp;  &amp; Estudio &amp; Ensayo\\   Periodístico &amp;  &amp;  &amp;  &amp; Noticia &amp; Art. opinión\\   Literario &amp; Descripción &amp; Novela &amp; Teatro &amp; \multicolumn{2}{c|}{Lengua literaria}\\ \hline \end{tabular} \end{center} \end{document}  Edit 2: Problem remains when changing tabular with tabu. Aditionally, it gives me a non fatal error when compiling: Overfull \hbox (57.79063 too wide) (page 2), lines 112-123. Since this table appears in the page 2 and the code lines match too, it probably wants to tell me something, but I don't know what it means.
20304
I am trying to build a table inside a LaTeX 3 command. A MWE:  \documentclass{article} \usepackage{xparse}  \ExplSyntaxOn \NewDocumentCommand{\createTable}{ m m }{     \begin{tabular}{|c*{#2}{|c}|}         \hline         \int_step_inline:nnnn {1} {1} {#1} {             ##1             \int_step_inline:nnnn {1} {1} {#2} {                 &amp; x             }             \\\hline         }     \end{tabular} } \ExplSyntaxOff  \begin{document}      \createTable{5}{4}  \end{document}   This gives me following ouput in which the column lines of the first column are too long:    In order to solve this problem I read questions         Though I still did not understand the actual nature of the problem (or its given solutions), I was able to reproduce the solution from .  \documentclass{article} \usepackage{xparse}  \ExplSyntaxOn \DeclareDocumentCommand{\fillRow}{ m m }{     #1     \int_step_inline:nnnn {1} {1} {#2} {     &amp; x     }     \\\hline }  \DeclareDocumentCommand{\BuildTable}{ m }{     \begin{tabular}{|c*{#1}{|c}|}     \hline }  \def\endBuildTable{     \end{tabular} } \ExplSyntaxOff  \begin{document}      \begin{BuildTable}{4}         \fillRow{1}{4}         \fillRow{2}{4}         \fillRow{3}{4}         \fillRow{4}{4}         \fillRow{5}{4}     \end{BuildTable}  \end{document}   This code outputs the desired result. But I don't like it because it needs 3 commands instead of 1 (minor issue). But most of all because of the verbose, redundant and inflexible syntax to generate the table. Therefore I decided to make an abstraction by putting the table-generating-commands in another command:  \documentclass{article} \usepackage{xparse}  \ExplSyntaxOn \DeclareDocumentCommand{\fillRow}{ m m }{     #1     \int_step_inline:nnnn {1} {1} {#2} {     &amp; x     }     \\\hline }  \DeclareDocumentCommand{\BuildTable}{ m }{     \begin{tabular}{|c*{#1}{|c}|}     \hline }  \def\endBuildTable{     \end{tabular} }  \DeclareDocumentCommand{\putTogether}{ m m }{     \begin{BuildTable}{#2}         \int_step_inline:nnnn {1} {1} {#1} {             \fillRow{##1}{#2}         }     \end{BuildTable} } \ExplSyntaxOff  \begin{document}      \putTogether{5}{4}  \end{document}   But this brought me back to my original problem because the column lines of the first column are too long again.  Could anyone   explain to me what exactly is wrong with my original code; what the difference is between the second and the third code fragments; how to edit my (original) code in order to solve my problem?
52724
In my table, in order to have texts centered in each cell, I am using  \newcolumntype{P}[1]{&gt;{\centering\arraybackslash}p{#1}}    and instead of a simple p{1.5cm}, I am using   &gt;{\centering\arraybackslash}p{1.5cm}    I am also using \toprule, \midrule, and \bottomrule along with \usepackage{booktabs}.  My code is the following:  \documentclass[12pt]{article}    \newcolumntype{P}[1]{&gt;{\centering\arraybackslash}p{#1}} \usepackage{multicol} \usepackage{multirow} \usepackage{booktabs}   \begin{document}   \begin{table}[h] \centering \begin{tabular}{| &gt;{\centering\arraybackslash}p{1.5cm} | &gt;{\centering\arraybackslash}p{1.2cm} | &gt;{\centering\arraybackslash}p{1.2cm} |  &gt;{\centering\arraybackslash}p{1.2cm} | &gt;{\centering\arraybackslash}p{1.2cm} |&gt;{\centering\arraybackslash}p{1.2cm} | &gt;{\centering\arraybackslash}p{1.2cm} | &gt;{\centering\arraybackslash}p{1.2cm} | &gt;{\centering\arraybackslash}p{1.2cm}|} \toprule \multirow{2}{*}{} &amp; \multicolumn{4}{c|}{Payoffs} &amp;  \multicolumn{4}{c}{ROR} \\ \cline{2-9}  &amp; $\theta =1$ &amp; $\theta =2$ &amp; $E(P)$ &amp; $\sigma(P)$ &amp; $\theta =1$ &amp; $\theta =2$ &amp; $E(r)$ &amp; $\sigma(r)$ \\ \midrule Asset 1 &amp; 110 &amp; 95 &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   \\ Asset 2 &amp; 105 &amp; 90 &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   \\ Asset 3 &amp; 120 &amp; 90 &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   \\ \bottomrule \end{tabular} \end{table}    \end{document}    And my result looks very strange like this:    First, the far right vertical line is short; the first row is not closed on the right.  Second, all the vertical lines are cut.  Any thoughts?
51207
I have a table table and the first column is a multirow. The multirow column text exceeds the column with.   \documentclass{article}  \usepackage[dutch]{babel} \usepackage{ragged2e} \usepackage{ltablex, multirow, makecell, caption}  \begin{document}  \keepXColumns\setcellgapes{3pt}\makegapedcells \begin{tabularx}{\linewidth}{|p{25mm}|*{3}{&gt;{\RaggedRight\arraybackslash}X|}}   \caption{My caption}   \label{my-label} \\    \hline  Onderwerp &amp; Persoonlijk niveau &amp; Professioneel niveau &amp; Samenlevingsniveau \\ \hline     \multirow{4}{*}{Perspectief: Wat is het hogere doel}      &amp; Wat is jouw hoge doel in het leven?  &amp; Wat is jouw hoge doel in je beroep? &amp;  Wat is jouw hoge doel in de samenleving? \\ \cline{2-4}     &amp; &amp; &amp; x \\ \cline{2-4}   \hline  \end{tabularx}  \end{document}     How can I make the text wrap and go to next line when the line is longer then the column width like the other columns?
40889
So I have this table, which I just used an online tool to create, but I want the columns to wrap. So, I just change \begin{tabular} to \begin{tabularx} and then the last column vertical line is about 1cm from the table... How can I fix that gap? \begin{tabularx}{\textwidth}{|X|X|X|X|} \hline Name:                                      &amp; Donald Trump                              &amp; Student ID:                                         &amp; 99999999                                     \\ \hline \multicolumn{2}{|p{0.5\textwidth}|}{Feedback focus:}                                                 &amp; \multicolumn{2}{p{0.5\textwidth}|}{asoidjfaopsidjfp oiajdfpo iasjdfp oiasjdfpo ij}                                \\ \hline \multicolumn{2}{|p{0.5\textwidth}|}{askdljf ;laksjdf;l aksjdf;lkajsd;:}                          &amp; \multicolumn{2}{l|}{as;ldifja;lsdkfja;lsdkfja; slkfj; aldkjf ;aslkdj ;alk}                         \\ \hline \hline \multicolumn{4}{|p{\textwidth}|}{as;ldkf;lkj: aklsduhf asldkj f;alskdjf ;alskdjf ;alskdf }                                                                  \\ \hline Fully Met                                  &amp; Met                                      &amp; Partially Met                                       &amp; Not Met                                      \\ \hline Comments:                                  &amp; \multicolumn{3}{l|}{}                                                                                                                         \\ \hline \multicolumn{4}{|p{\textwidth}|}{asldkjf;alksdj f;laksjdf:as;dlk ja;lsdk fjas;ldkfj a;slkdfj ;lakasdlk;jkdj }                                                                               \\ \hline Fully Met                                  &amp; Met                                      &amp; Partially Met                                       &amp; Not Met                                      \\ \hline Comments:                                  &amp; \multicolumn{3}{l|}{}                                                                                                                         \\ \hline \multicolumn{4}{|p{\textwidth}|}{a;lsdkjf; lakj;l3: alkjdsf l;aksjdf;l kasjd;lf kjasd;l fkjas;ldkfjas;ldkf jas;ldkf ja;sldkfj asldkfj alksjferopijp34qjp asdf} \\ \hline Fully Met                                  &amp; Met                                      &amp; Partially Met                                       &amp; Not Met                                      \\ \hline Comments:                                  &amp; \multicolumn{3}{l|}{}                                                                                                                         \\ \hline \multicolumn{4}{|p{\textwidth}|}{as;ldkfjal;kej ;l4: alskdjf ;lasdkjf ;alskdjf ;laskd}                                                                                                                      \\ \hline Fully Met                                  &amp; Met                                      &amp; Partially Met                                       &amp; Not Met                                      \\ \hline Comments:                                  &amp; \multicolumn{3}{l|}{}                                                                                                                         \\ \hline \multicolumn{4}{|p{\textwidth}|}{asl;dkjf;lk4j: asl;dkjfaslkdjf eirkajp (asl;dkfj a) aslkdjf l}                                                                                             \\ \hline Fully Met                                  &amp; Met                                      &amp; Partially Met                                       &amp; Not Met                                      \\ \hline Comments:                                  &amp; \multicolumn{3}{l|}{}                                                                                                                         \\ \hline \end{tabularx}  Gives:
40050
\documentclass[fleqn,12pt,a4paper]{article} \usepackage{tabularx} \begin{document}   \begin{table}[ht]     \begin{minipage}[b]{1 \linewidth}\centering       \begin{tabular}{|c|c|c|c|c|}       \hline         Tri Sankhya &amp; Vihbakti &amp; Ekavachana &amp; Dvivachana &amp; Bahuvachana \\       \hline         Pra Trik    &amp; Prathama &amp; Su (s)     &amp; Au &amp;  \\         Dvi Trik    &amp; Dvitiya  &amp; Am         &amp; Aut (Au) &amp;  \\         Tri Trik    &amp; Trutiya  &amp; Ta (A)     &amp; Bhyam &amp; \\          Cha Trik    &amp; Chaturthi&amp; Ne (E)     &amp; Bhyam &amp; \\         Pan Trik    &amp; Panchami &amp; Nasi (as)  &amp; Bhyam &amp;   \\         Shas Trik   &amp; Shashthi &amp; Nas (as)   &amp; Os &amp;   \\         Sap Trik    &amp; Saptami  &amp; Ni (ee)    &amp; Os &amp;   \\       \hline       \end{tabular}       \caption{Subanta Pratyaya}     \end{minipage}   \end{table} \end{document}    In the attached image, I would like to place text in the last column at 90 degree rotation but do not know how to do it. Also, how can I color the background of that entire column only.  .
100281
EDIT Like some comments below are remarking the table environment doesn't allow tables over more than one page. However the solution works fine  I need to make a table over more than one page. The standard approach seems to be to use the ltablex environment. However, it doesn't work; also I assume that the table environment may also be required for the thesis template I work on (e.g. suppose for the capture).   \documentclass[11pt]{article} \usepackage{booktabs} \usepackage{tabularx} \usepackage{ltablex}  \begin{document}  \begin{table} \caption{Example of an table} \label{tab:daypack}      \begin{tabularx}{\linewidth}{@{}cX@{}}   \toprule \textbf{Column 1} &amp; \textbf{Column 2} \\[6pt] \midrule \endhead $R$ &amp; 1This is an example sentence \\[6pt] $R$ &amp; 2As well as the line before \\[6pt] $A$ &amp; 3Also this is an example \\[6pt] $R$ &amp; 4This is an example sentence \\[6pt] $R$ &amp; 5As well as the line before \\[6pt] $A$ &amp; 6Also this is an example \\[6pt] $R$ &amp; 7This is an example sentence \\[6pt] $R$ &amp; 8As well as the line before \\[6pt] $A$ &amp; 9Also this is an example \\[6pt] $R$ &amp; 10This is an example sentence \\[6pt] $R$ &amp; 11As well as the line before \\[6pt] $A$ &amp; 12Also this is an example \\[6pt] $R$ &amp; 13This is an example sentence \\[6pt] $R$ &amp; 14As well as the line before \\[6pt] $A$ &amp; 15Also this is an example \\[6pt] $R$ &amp; 16This is an example sentence \\[6pt] $R$ &amp; 17As well as the line before \\[6pt] $A$ &amp; 18Also this is an example \\[6pt] $R$ &amp; 19This is an example sentence \\[6pt] $R$ &amp; 20As well as the line before \\[6pt] $A$ &amp; 21Also this is an example \\[6pt] $R$ &amp; 22This is an example sentence \\[6pt] $R$ &amp; 23As well as the line before \\[6pt] $A$ &amp; 24Also this is an example \\[6pt] $R$ &amp; 25This is an example sentence \\[6pt] $R$ &amp; 26As well as the line before \\[6pt] $A$ &amp; 27Also this is an example \\[6pt] $R$ &amp; 28This is an example sentence \\[6pt] $R$ &amp; 29As well as the line before \\[6pt] $A$ &amp; 30Also this is an example \\[6pt] $R$ &amp; 31This is an example sentence \\[6pt] $R$ &amp; 32As well as the line before \\[6pt] $A$ &amp; 33Also this is an example \\[6pt] $R$ &amp; 34This is an example sentence \\[6pt] $R$ &amp; 35As well as the line before \\[6pt] $A$ &amp; 36Also this is an example \\[6pt] $R$ &amp; 37This is an example sentence \\[6pt] \bottomrule \end{tabularx}    \end{table}      \end{document}
47959
I'm dealing with the powerful tabularx environment. I was able to obtain a nice table, except for the last column. I need seven columns in total, but at the end I got another half column. I can't understand why!  Here the code I used for building the table:  \begin{table}[h!]  \begin{tabularx}{\textwidth}{|l|*{20}{&gt;{\arraybackslash}X|}}  \multicolumn{1}{c}{}&amp; \multicolthead{3}{\color{RoyalBlue}\textbf{I}}&amp; \multicolthead{3}{\color{RoyalBlue}\textbf{II}} &amp; \multicolthead{3}{\color{RoyalBlue}\textbf{III}} &amp; \multicolthead{3}{\color{RoyalBlue}\textbf{IV}} &amp; \multicolthead{3}{\color{RoyalBlue}\textbf{V}} &amp; \multicolthead{3}{\color{RoyalBlue}\textbf{VI}} \\  \hline  \thead{\color{RoyalBlue}One\\\color{RoyalBlue} Time} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} \\  \hline  \thead{\color{RoyalBlue}Two\\\color{RoyalBlue} Times} &amp; &amp; &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; &amp; &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \\  \hline  \thead{\color{RoyalBlue}Three\\\color{RoyalBlue}Times} &amp; \multicolumn{3}{l|}{} &amp; &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; &amp; &amp; \multicolumn{3}{l|}{} \\   \hline  \thead{\color{RoyalBlue}Four\\\color{RoyalBlue} \&amp; Times} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; \multicolumn{3}{l|}{} &amp; &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; \cellcolor[HTML]{D3D3D3} &amp; &amp; \\  \hline  \end{tabularx} \caption{{Caption}} \end{table}   Which produces the following output:    Does anyone have an idea?
62360
I used some of the solution proposed in this post:    and my code is as follows:  \documentclass{standalone} \begin{document}  \begin{tabular}{c*{11}{@{\,}c}}       2&amp;:&amp;7&amp;=&amp;0&amp;,&amp;$\overline{2}$&amp;$\overline{8}$&amp;$\overline{5}$&amp;$\overline{7}$&amp; $\overline{1}$&amp;$\overline{4}$       \\       {\color{red} 2} &amp;{\color{red} 0 } &amp; &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp; \\       1 &amp; 4 &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;  \\  \cline{1-2}        &amp; 6&amp; 0 &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;  \\        &amp; 5 &amp; 6 &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;  \\   \cline{2-3}        &amp;  &amp; 4 &amp; 0 &amp;&amp;&amp;&amp;&amp;&amp;&amp;  \\        &amp;  &amp; 3 &amp; 5 &amp;&amp;&amp;&amp;&amp;&amp;&amp;  \\  \cline{3-4}        &amp;  &amp;      &amp; 5 &amp; 0 &amp;&amp;&amp;&amp;&amp;&amp; \\        &amp;  &amp;      &amp; 4 &amp; 9 &amp;&amp;&amp;&amp;&amp;&amp;  \\  \cline{4-5}        &amp;  &amp;      &amp;   &amp; 1 &amp; 0 &amp;&amp;&amp;&amp;&amp; \\        &amp;  &amp;      &amp;   &amp;   &amp; 7 &amp;&amp;&amp;&amp;&amp; \\ \cline{5-6}        &amp;  &amp;      &amp;   &amp;   &amp; 3 &amp; 0 &amp;&amp;&amp;&amp; \\        &amp;  &amp;      &amp;   &amp;   &amp; 2 &amp; 8 &amp;&amp;&amp;&amp; \\  \cline{6-7}        &amp;  &amp;      &amp;   &amp;   &amp;   &amp; { \color{red} 2} &amp;{\color{red} 0} &amp;&amp;&amp;     \end{tabular} \end{document}   The goal is to show the repeating decimal part with overline over the repeating decimals. The code does that, but each decimal is overlined in isolation, but I want a continuous overline!  But that does seem to infer with the mechanics of tabular ...