# Tables: messed up vertical alignment and badness

I have to rely on you guys again. I thought it was a simple job, it wasn't. And again I have to rely on you guys.

\documentclass[a4paper,11pt,twoside]{article} \usepackage{booktabs, array} \usepackage{multirow, makecell, caption} \begin{document} \begin{table} \tabcolsep=0.11cm \small \caption{caption} \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline \multirowcell{2}{looong\\long\\text} & {} & \multicolumn{5}{p{6cm}}{\center long longer longest text  long longer longest text  long longer longest text  long longer longest text  long longer longest text} & {} & \multirowcell{2}{**}\\ \cline{3-8} & * & \multicolumn{1}{p{1cm}}{long long text} & \multicolumn{1}{p{1cm}}{long long text} & \multicolumn{1}{p{1cm}}{long long text} & \multicolumn{1}{p{1cm}}{long long text} & \multicolumn{1}{p{1cm}}{long long text} & \multicolumn{1}{p{2cm}}{ long longer longest text long text} & \\ \hline 1   &2  &3  &4  &5  &6  &7  &8  &9\\ \hline 0   &1774&  83.05\% &81.72\%    &85.78\%    &81.14\%    &100\%  &86.34\%    & -4.11\%  < 0.02\%\\ \hline ... & ... & ... & ... & ... & ... & ... & ... & ... \\ \hline 124 &1650   &86.43\%    &81.56\%    &85.77\%    &80.95\%    &100\%  &86.94\%                       & -0.64\% < 0.02\%\\ \hline 144 &1630   &87.02\%    &81.53\%    &85.77\%    &80.91\%    &100\%  &87.05\%    & -0.03\%< 0.02\%\\ \hline 145 &\multirowcell{1}{x1j iv =\\ 1629}  &87.04\%    &81.53\%    &85.77\%    &80.91\%    &100\%  &87.05\%    & -0.01\% < 0.02\%\\ \hline \end{tabular} \end{table} \clearpage \end{document}  


Instead of multicolumn{p} I have tried multirowcell, which produced the lines great, but row height was a mess. And obviously it provides like 20 10000 badness errors. I think this table exceeds my teX knowledge. Please help!

Replay

Is this more like you want?

\documentclass[a4paper,11pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe ]{geometry}
\usepackage{array ,multirow, makecell, cellspace, caption, tabularx}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}

\usepackage{stackengine}
\setstackEOL{\\}

\begin{document}

\begin{table}
\tabcolsep=3.5pt
\small
\caption{caption}
\begin{tabularx}{\linewidth}{|c|Sc|*{5}{Sc < {\,\%}|}>{\centering}X<{\,\%}|>{$}c<{$}|}
\hline
\multirowcell{6}[-1ex]{looong\\long\\text} & {} & \multicolumn{6}{S{p{\dimexpr 7cm + 12\tabcolsep + 2.4pt\relax}}|}{\centering long longer longest text long longer longest text long longer longest text long longer longest text long longer longest text} &%
\\ \cline{3-8}
& * \\ \hline
1 & 2 \\ \hline
0 & 1774 \\ \hline
... & ... \\ \hline
124 & 1650 \\ \hline
144 & 1630 \\ \hline
145 & \Centerstack{x1j iv = \\ 1629} &87.04 &81.53 &85.77 &80.91 &100 &87.05 & -0.01\,\% < 0.02\,\%\\ \hline
\end{tabularx}
\end{table}
\clearpage

\end{document}



Category: tables Time: 2016-07-30 Views: 1

## Related post

• Problem with vertical alignment and centering of caption for pgfplot 2015-11-04

I am having a problem keeping the vertical alignment of the plots. Also, my caption text is not centered. This is what I get in my document: Can you assist me in getting the graphs to align vertically and the caption text to show centered? Thanks. He

• How to vertically align and float two text boxes (left and right) in scaling header 2016-01-15

/* Importing Amaranth Font for menu text */ @import url(http://fonts.googleapis.com/css?family=Amaranth); header, a, img, li { transition: all 1s; -moz-transition: all 1s; /* Firefox 4 */ -webkit-transition: all 1s; /* Safari and Chrome */ -o-transit

• Pgfplotstable multicolumn table with dec sep align and Tabularx 2014-11-29

I would like to implement a multicolumn table with Pgfplotstable that aligns on one side the number of the columns by dec sep align and secondly aligns the whole table by Tabularx. A version without Tabularx can be seen below: Similar questions have

• vertical align and color in table with multirow 2012-07-19

I have the following table: \documentclass[a4paper]{report} \usepackage{booktabs} \usepackage{multirow} \usepackage[table]{xcolor} \begin{document} \begin{table}[htbp] \centering \begin{tabular}{l c c c} \toprule Group & Par. & Measure & Metri

• How do I move the table to the vertically center, and align figure and table together? 2015-05-25

\begin{figure}[htbp] \centering \makebox[0.5\textwidth]{\includegraphics[width=0.7\textwidth]{figure/ch3/result_s2/book.jpg}} \qquad \qquad \scalebox{0.7}{ \begin{tabular}[c]{cc} \hline \textbf{Method} & \textbf{$\sigma$} \\ \hline method 1 & 0.0

• Problem with custom vertical-alignment and/or length of lines/rules in tabular environment 2013-07-07

As a follow-up to my previous question: In my table / tabular, \cline{1-1} gives me the correct vertical position but not the right horizontal length . In contrast, \rule{\mycustomlength}{0.4pt} gives me the right (horizontal) length but not at the c

• Table within table fouls up vertical alignment of neighboring cells! 2013-08-23

I nested a table inside of my table like this: \begin{tabular}{p{1in}||p{5in}} \hline This should be on top. & \begin{tabular}{@{\extracolsep{\fill}}lr} Thing1 & Thing2 \\ Thing3 & Thing4 \\ Thing5 & Thing6 \\ Thing7 & Thing8 \\ \end{t

• Table with multirow vertical arrow and text 2016-01-25

I would like to annotate a table with an arrow along the right side representing (in this case) decreasing operator precedence for a computer language. I am familiar with the other solution listed here, which involves placing the entire table in math

• 3 subfigures, 2 vertically aligned and one hortizontally 2014-09-08

I'm trying to set up a main figure containing three sub figures. The idea is to split them in such way that it shows a two columns figure where the second column is made out of two sub figures located in a row configuration. This might be hard to ima

• Vertical alignment of table cells and defining column width 2015-12-22

I'm currently experimenting with building an Excel app that writes latex code for a table from a selection area within Excel. Essentially the user selects their table in Excel, clicks a button, and the latex code for the table is written into a local

• Problem with Table Vertical Alignment 2010-12-01

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} \beg

• Two tables vertically align 2011-03-17

i have two tables, each of them has 4 columns. one is just below the other. i want to know how to make every column of the below table have same width of the column of the above table. it looks like this: |-------|-------|-------|-------| | | | | | |

• vertically align cell in table that includes minipages 2015-11-21

In the following table (code included below), how can I vertically center the text RowName1? (note that each bulleted list must be within a minipage environment). Code: \documentclass[letter]{article} \usepackage{booktabs} \begin{document} \begin{tab

• Easy and robust way to vertically align text and images side by side 2015-03-08

Is there any syntactically easy and robust solution of how to place a image right (or left) to a text with correct vertical alignment (and appealing horizontal spacing)? By syntactically easy I mean it should be at least as simple as the (not working

• vertical-align only one inline block element 2016-01-27

I have 3 inline block elements, an image and two pieces of text. I would like to modify the class for only the image such that it is middle aligned while the other two text blocks remain top aligned. It seems to only work if I set .subImg to have ver

• Vertical align link text in a percentage height list 2016-02-04

I want to align the link text vertically in the <li> list. I tried several ways, but couldn't find the solution. I must keep the percentage height. A sample version of my code: https://jsfiddle.net/kr0mf4oe/3/ div#html { height: 500px; } div#main {

• How do i vertically align my form in bootstrap? 2016-02-09

Dear stackoverflow users, I am trying to make a simple site with only a register and login page to learn how to make a register and login system using php. Bootstrap is the css library I use to do the design of the website. I need to vertically align

• Vertical aligning for simple numbers 2014-09-05

I need to typset a series of fractions with no line inside some paragraphs of text (they were used as proportional symbols). It is very simple, actually: $^2_1$, $^4_2$,$^8_4$ But when it comes to $^{12}_{6}$, the two numbers are not aligned vertical

• Vertically align two horizontally-parallel equations 2014-10-10

I am attempting to vertically align two equations at multiple points and I have come up with the following: \begin{array}{rlclcl} \eta(n)&\equiv&\frac{\Lambda(n)}{\log n}&\equiv&\sum_{d\mid n}&\mu\left(\frac nd\right)\log_nd\\ \eta(p(x