A package providing some additional commands to enhance the quality of tables in LaTeX.

learn more… | top users | synonyms

36
votes
1answer
830 views

booktabs: What is the difference between \toprule and \hline

The horizontal lines in tabular environment can be constructed. What is the difference between \toprule, \midrule, \bottomrule and specifying horizontal line using \hline?
27
votes
3answers
6k views

Professional-looking tables with alternating row colors?

Both the Booktabs documentation and the Small Guide to Making Nice Tables provide some nice rules-of-thumb for making professional-looking tables (e.g., no double rules, no vertical rules, etc.) Q: ...
18
votes
6answers
1k views

How to increase row height while using booktabs?

I'm making a table using booktabs. One of the columns contains a series of fractions. \documentclass[12pt, letterpaper]{article} \usepackage{nag} \usepackage[margin=1.0in]{geometry} ...
14
votes
1answer
539 views

\cmidrule with booktabs in beamer does not show up

I am trying to use a coloured \cmidrule in a table in beamer - however, it does not show up. I have read Strange disappearing colored rules in beamer which indicates that this is a bug and discusses ...
12
votes
2answers
423 views

Slovak (and Czech) babel gives problems with cmidrule and cline

I tried to use the Slovak language with the booktabs package. Let's see a couple of cases. slovak is included in the options to babel \usepackage[english,slovak]{babel} or ...
12
votes
1answer
4k views

Coloring columns in a table with colortbl and booktabs

I have created a rather complicated table with some columns that I want to color. For the table, I chose the booktabs and tabularx packages. For coloring the columns, I use colortbl. The problem that ...
12
votes
1answer
367 views

Use of \midrule in booktabs table

Are there any formal guidelines/suggestions on the use of \midrule inside a booktabs table with just rows of identically formatted data? The booktabs manual is very specific about vertical rules, ...
11
votes
3answers
752 views

Horrible table layout

I have a table which gives an overview of some theory. It includes a lot of words or combination of words. The layout is horrible and not LaTeX quality. Some guidance as to how to improve would be ...
10
votes
2answers
348 views

Table using booktabs and cellcolor looks ugly

When using \cellcolor in a booktabs table, I find that the output is not really appealing: I don't really care that the colored cell does not touch the lines above and below (cf. Coloring columns ...
9
votes
2answers
2k views

\midrule dashed and colored in booktabs — two kinds of midrules in one booktab

Is it possible to make two \midrules in one booktab? The first one should be colored, the second one colored and dashed, as it is shown in the picture. Before each entry is a horizontal space - how to ...
9
votes
1answer
418 views

Wrapping \cmidrule in a macro

In my earlier solution for Multivariate polynomial long division using LaTeX I had wrapped \cmidrule in a macro as its syntax alowing to shorten the end points was not standard: ...
9
votes
1answer
2k views

Vertical table lines are discontinuous with booktabs

I created a table in LaTeX, but there are some problems with the borders. The borders remain open whereas I want them closed. Also, in the last row, I want the vertical line gone, ie I want just one ...
8
votes
1answer
413 views

How can I make a table like the type in this image in LaTeX?

I'm trying to make a table like the one in following image in LaTeX but I'm unsure how to go about it. I've been using the tabular environment from the booktabs package, but the following code ...
8
votes
1answer
4k views

Vertical lines are being broken up (disrupted) by the horizontal booktabs lines

My vertical lines are being broken up (disrupted) by horizontal booktabs lines. How can I fix this? It's well and good to say use \hline but I also need a cmidrule that spans only the second two ...
8
votes
3answers
2k views

Fill space with dots within table

I would like the whitespace between two items within a table to be filled with dots. Please consider the following picture to get the idea. So far I tried to achieve this output with the following ...
7
votes
3answers
153 views

Table inside enumeration: How to align vertically when using booktabs' \toprule?

I want to display a table inside an enumerate environment such that the first row aligns with the item label. My current code is the following: \documentclass{article} \usepackage{enumitem} ...
7
votes
2answers
1k views

Longtable does not break correctly when used with \specialrule instead of \hline

I'm writing an application that generate latex code, therefore the solution must be the most generic possible to ensure that it will generate clean pdf all the time. I would like to let my users ...
6
votes
2answers
387 views

\cmidrule with two multirows not behaving correctly?

Here is the code: \begin{table} \centering \begin{tabular}{rrrrr} \toprule \multirow{2}{*}{b} & \multicolumn{2}{c}{QCDH} & Single & \multirow{2}{*}{$\frac{\pi_{q1}}{\pi_{s1}}$} \\ ...
6
votes
1answer
709 views

How to omit vertical realignment when using cmidrule in different colors?

My question is similar to the one here How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule? but can not be solved with the suggested answer (because the lines are ...
6
votes
1answer
212 views

booktabs's horizontal rules aren't displayed with cifa document class

There seems to be a problem between the CIFA document class and the booktabs package. When I compile the following code, the horizontal lines are not displayed: \documentclass{cifa} ...
5
votes
3answers
255 views

slim braces in a table

We need to make clear that certain data is the same in several rows. An underbrace taken from math-mode does the job quite well, but is unfortunately way too prominent in the table, especially in ...
5
votes
6answers
232 views

ltablex and booktabs

I need a table which is larger than one page and it should have a fixed size. To improve the look, I use booktabs. However, the foot of the table is not nice on all pages, except on the last page. ...
5
votes
2answers
5k views

Problems with \toprule and \midrule in a table

Having the following siunitx table code in LyX, for each occurrence of \toprule and \midrule I obtain an error message: The control sequence at the end of the top line of your error message was ...
5
votes
3answers
3k views

Formatting table border and text alignment in LaTeX table

I have the following table in the .tex file: \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table}[htbp] \centering \caption{Distribution of Number of Injured ...
5
votes
1answer
315 views

How to trim the length of \toprule? [duplicate]

How to trim \toprule (from booktabs package)? It is probably something basic I'm missing, but I need it and it's nowhere to be found.
5
votes
1answer
292 views

Decimals in table don't align with dcolumn when bolded

I am making a table using booktabs and dcolumn. It works perfectly until I tried to bold one of the numbers and then the decimals won't read properly. Are there any workaround here? ...
5
votes
1answer
2k views

Big table with rotated column labels using booktabs

I'm trying to get a big table to fit into my document using the booktabs package, but it is too wide. An example of a couple of rows of the table is given below. I'm using the ...
5
votes
1answer
786 views

multirow and text wrapping

I have a problem using multirow along with text wrapping when spanning cell contains a lot of text. Here is my code: \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} ...
4
votes
1answer
4k views

\midrule before \endhead in longtable environment with booktabs package

I am trying to use longtable with repeating headers on each page. For example: Column 1 & Column 2 & Column 3 \endhead \midrule results in an ugly multi-page table. The horizontal rule ...
4
votes
2answers
87 views

Do the different rules generated by booktabs have the same thickness?

I use the booktabs package and excel2latex to generate my tables. I work in TeXmaker. As I zoom in or zoom out on my table, I find that, sometimes the \toprule, sometimes \midrule and sometimes the ...
4
votes
2answers
65 views

How to trim horizontal line ends in table with vertical lines?

How to obtain something like this ? The only way for trimming horizontal line in table that I found is using booktabs. The problem with booktabs is that it doesn't manage good vertical lines. I ...
4
votes
2answers
936 views

Longtable width exceeds page

I saw these topics and sure they help a lot, Resize longtable to width of landscape page How to fit landscape multi-page table to textwidth But still it does not fix my problem for some reason. I ...
4
votes
1answer
593 views

How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule?

I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table. However, when \arrayrulecolor is used with \cmidrule, some odd ...
4
votes
1answer
119 views

Serious problems with table layout

I have some issues when creating my OLS regression in LaTeX and really hope, that some of you could help me. (I do not know how to make more columns and to add text like: ...
4
votes
1answer
3k views

Equations inside tabular environment, no vertical spacing

I have a problem with the spacing of my equations. According to this http://tex.stackexchange.com/a/50348/15360 booktabs one should rarely have to regulate the spacing. But the result of the code ...
4
votes
1answer
434 views

How can I use renewcommand for toprule of the booktabs package?

I have a LaTeX document and want to change the thickness of \toprule and \bottomrule to 1.5pt. Is there a way to do this with the \renewcommand or do I have to change every \toprule to ...
4
votes
2answers
3k views

Vertical alignment using multirow and booktabs

I'm trying to format correctly the following table: \documentclass[a4paper,twoside]{report} \usepackage{array,colortbl,multirow,multicol,booktabs,ctable} ...
4
votes
1answer
263 views

Table and \hlines too short or wide

Here is a MWE of what I am trying to do. \documentclass[a4paper]{article} \usepackage{tabularx,booktabs} \usepackage{color,colortbl} \begin{document} \begin{table}[htb] \centering ...
4
votes
2answers
487 views

Conflict between `booktabs` and `arydshln` packages

Please see the MWE below and its result. I didn't use the arydshln package in the example, but I have to use it somewhere else in the same document. As you see, there is something wrong with the ...
4
votes
1answer
1k views

Format nomencl in table style

For my thesis I wwant to format the nomencl in the same style as the rest. Simply put this means I want the nomencl to appear as follows: Symbol Quantity Unit t Time s rest ...
4
votes
2answers
2k views

Vertical spacing in tables with math

How can I force LaTeX to vertically center math in a table taking into account subscripts, superscripts, etc? It appears from the output below that LaTeX vertically centered the $JV$ and added the ...
4
votes
3answers
58 views

How to use \shortstack together with \arraystretch to achieve the same row separation?

When I use \shortstack to create newline in a table cell, the row separation is not the same as defined by the value of \arraystretch. The following MWE shows the problem: ...
4
votes
1answer
148 views

Booktab color rows with multicolumn

I would like to color certain rows in my booktabs table. I have tried the following \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{colortbl}% ...
4
votes
1answer
3k views

How to use \abovetopsep (to add space between a table's caption and tabular part)?

I read in the documentation of the booktabs package that \abovetopsep can be used to add some space between a table and its caption (instead of the lower-level \vspace{}). However, the exact placement ...
4
votes
1answer
200 views

Equivalent of \DTLiflastrow

With the datatool package there is a \DTLiffirstrow. I am looking for a similar command to detect the last row, \DTLiflastrow, but could not find one. I attempted to create my own but was not ...
4
votes
1answer
708 views

'longtable' and 'booktabs' not working on this example?

I am not even sure what is wrong here. I have a table I would like the caption to be at bottom, marked with (continued) from 2nd page onwards. I would like the table to break at certain places by ...
3
votes
4answers
152 views

Help with a booktabs table

I'm a relatively new user to Latex, and this is the first time I am attempting to construct a table for my thesis. I would like the table to look like this: Following some research on the internet, ...
3
votes
2answers
60 views

Modify global size of booktabs table

Here is the table I am trying to make: \documentclass{book} \usepackage{tabularx, booktabs} \usepackage{lipsum} \begin{document} \begin{table} \centering \begin{tabularx}{\textwidth}{lll} ...
3
votes
2answers
407 views

Table layout: cells with short and long text

I've been fiddling with a table layout where some cells contain very little text while others may need multiple lines, and I can't seem to get it readable and nice-looking. MWE: ...
3
votes
2answers
2k views

how to vertically align text in multirow cell with tabularx with renewcommand?

Here I come again, Following the indications on this url I managed to get almost exactly what I want. However the problem is that the first multirow cell (with text "5 and 6") is not vertically ...