59

My question is a follow-up to the answer to a follow-up question, to be found here. ;)

I'd like to know why one would advise against using vertical lines (via |) in a tabular (i.e. in \begin{tabular}{|c|c|})? Or is it simply a matter of finding 'nicer' formats, which don't require vertical lines?

Count Zero
  • 17,424
  • 28
    Read the manual for the booktabs package. – Torbjørn T. Jan 09 '12 at 15:48
  • 17
    I usually say that rules in tables are like barriers; one should use them only when they delimit different parts of the table; a table row is a single part of the table, in general, so it shouldn't have delimiters in it. – egreg Jan 09 '12 at 15:54
  • 1
    My statement there was purely based on aesthetics. It is almost always a bad idea to use vertical lines in tables. There are of course other uses for tabulars besides tables where they could be used. – Roelof Spijker Jan 09 '12 at 15:54
  • It is considered bad typography. But I don't know exactly why. Perhaps because table columns require different space in general, depending on their content and it is simply ugly to have irregularly spaced vertical lines on the final typeset page. – AlexG Jan 09 '12 at 15:59
  • Hmmm... So it actually boils down to aesthetics... I can think of an example where you want this kind of vertical separation: a pocket calendar, with the days of the week in the first line and the number of the week in the first column. I believe that there a vertical line after the first column would be more than welcome. – Count Zero Jan 09 '12 at 16:09
  • @CountZero Typographical criteria are not just aesthetics. What is important is readability. For a pocket calendar this may not apply, because it is not something you actually "read" from left to right. – Roberto Bonvallet Jan 09 '12 at 17:49
  • 9
    it is a rumor that there are official typographical rules for not using lines in tabulars. And there is also no scientific investigation on reading tabulars with and without lines. It is only a more or less common sense that vertical lines make tabulars less readable. But no one can prove that! However, I prefer less lines in a tabular. –  Jan 09 '12 at 18:01
  • 3
    While I agree with the statements made in the booktabs package in general, I find it very sad that those statements are used by the author as justification to not support vertical lines. There are several good reasons for using vertical lines in certain use cases (like emulating existing layouts, or because you have tables meant to be read vertically), and in those cases, the very nice spacing features from booktabs simply cannot be used. :-( – DevSolar Mar 26 '12 at 11:39
  • 1
    I wish I could downvote RTFM comments. – naught101 Nov 05 '12 at 01:20

3 Answers3

52

This is the usual typography rule: you do not want to put on the page something that interrupts the eye movement from left to right. A generous spacing between the columns and alignment give enough information about the columns; extra rules make reading more difficult.

Boris
  • 38,129
  • 8
    +1: could you provide a reference or two for further reading. – cmhughes Jan 09 '12 at 20:08
  • 4
    @cmhughes I hesitate recommending a book I myself did not yet read, but I've read another book by the same author, so probably I can do it. Anyway, I leafed through "Show Me the Numbers: Designing Tables and Graphs to Enlighten" by Stephent Few, and he seems to discuss this issue in detail. Another good book is Doumont's "Trees, Maps and Theorems", but I cannot recall whether he specifically discussed tables (my copy is at home, and I am at my office right now...) – Boris Jan 09 '12 at 21:39
  • 3
    -1. This takes no consideration of how data is supposed to be read. Other answers have amply shown that some data is meant to be read vertically, in which case horizontal lines only get in the way, at least in the body of the table. – naught101 Nov 05 '12 at 01:19
46

I'll voice a dissenting opinion: of course you can use | in a tabular, you just have to be careful how it is done.

Never forget that the booktabs way of doing tables is only one among many. If you look at old books about typography, you'll see that they do perfectly readable tables not by using only horizontal rules, but, on the contrary, by using nearly only vertical ones. Here's is a couple of examples from Lefevre's Guide pratique du compositeur d'imprimerie (from the prestigious French printing house Didot):

First example of Table form Lefevre's Guide pratique du compositeur d'imprimerie

Second example of Table form Lefevre's Guide pratique du compositeur d'imprimerie

Of course, in LaTeX, the problem is that

  • making a good-looking table with booktabs is easy
  • standard LaTeX tabulars using both | and \hline are truly horrid
  • tweaking a LaTeX tabular to correctly space things with respect to \hline and space between rows requires a lot of work (the cellspace package can help)
  • 29
    Some respected typographers say that 19th century typography marked a big decline from the past. That table would be more readable without braces and vertical rules, just by setting the dates aligned with the first day observation and adding a space between different dates. Just an opinion, of course. – egreg Jan 09 '12 at 18:20
  • 1
    @egreg I'd add that rotated headers in some columns in this table look horrible to me. Am I supposed to turn my head 90 degrees to read headers? Also, using "" for repeated data is distracting. Again, just an opinion. – Boris Jan 09 '12 at 18:59
  • 13
    @egreg: now, that's a quick assassination of a whole century of typography: the decline started at the middle of the century, not at the beginning, which was a golden age of typography with many important masterpieces by renowned typographers like Didot and Bodoni (and I'd like to know who your respected typographers are, because I'm pretty sure they weren't thinking about table typesetting when they said that). Because not all tables are meant to be read horizontally, the vertical rules serve a purpose as they ease the vertical reading of the data. – Philippe Goutet Jan 09 '12 at 22:04
  • 4
    @Boris: Reading short vertical text is a thing we are all used to do (e.g. when looking at the spines of books on a shelf). You might dislike it, but how else would you put whole long words in short columns without using any form of abbreviation? Space is sometimes a concern and you must adapt your typography. And using " for repeated data is not a distraction, but a good practice: you immediately see that the data is the same. It's quite common to do that, and you often see the same thing in bibliographies where the author is replaced by --------- instead of being repeated. – Philippe Goutet Jan 09 '12 at 22:04
  • 1
    Well, one might remark that Lefevre's book was published in 1855. :) I stand on my position: that book devotes only 11 pages to tables and the examples are awful. Just an opinion, of course. I agree that not all tables have a main horizontal direction, but those do. – egreg Jan 09 '12 at 22:26
  • 4
    @egreg One has to distinguish typographical rules from fashion. A good typographical rule is consistency; not sure if one can be as absolute with vertical and horizontal rules in tables. A reason than vertical rules started disappearing from books was costs and the fact that the type used to wear out easily and fall off. Nothing to do with readability. – yannisl Jan 09 '12 at 23:09
  • @Boris Using """ makes the value clearer. If you leave it out does that mean same as above or that you don't have any data? – yannisl Jan 09 '12 at 23:43
  • 1
    @YiannisLazarides I would just repeat the previous data: it looks cleaner. – Boris Jan 10 '12 at 01:13
  • 6
    @egreg: don't give too much importance to the date 1855. In earlier books (e.g. Brun's Manuel Pratique of 1826 or even Fournier's Manuel typographique of 1764), you see exactly the same kind of tables: they were just done like that at that time. Vertical reading is important in the second table, e.g. if you want to see the evolution of the temperature, so I would not call it "mainly horizontal". – Philippe Goutet Jan 10 '12 at 14:37
40

A problem I find with typography "rules" is that a lot of them read like the ten commandments. They tell you what not to do, rather what to do and rarely talk about exceptions. For example this table would read better with vertical rules.

enter image description here

Why would it read better? If you had to curve fit any of the observations you would read from top to bottom, a column a time, for example the comet distance. In general (my rule/observation), if you don't need a heading on the first column of a table, you are better off with vertical rules. Note that if you adopt such an approach the table will look better if you minimize the horizontal rules.

There are many exceptions. Any table that has information similar to a table of logarithms, trigonometric functions etc. At a point in time there was the DIN 55 301 (1978) standard that dictated vertical and horizontal rules for statistical tables with the motivation to present data clearly. According to the same standard cells in a numerical table should not be left vacant. If the cell is left empty the value of the data in that cell becomes unclear. If its value is "0" better to state it. An en-dash normally signifies an absence of data. I normally use ditto rather than "''" if the data is the same as the cell above.

Sometimes, no rules might blend with the text better,

enter image description here

In general though as Tufte says, it is better not to imprison your data in grids of cells. This is very common in business reports, where one picks an excel table and shows it in a similar fashion in a publication. If you are in doubt use "Firer's Rules", but it is good to be aware of the exceptions. Tables are meant to be read (otherwise don't include them). Read them aloud as you would a sentence, normally this would give you a clue as to the best way to lay them out as well as to where rules should be placed.

As an aside, the tables are from Newton's Principiae. Astronomical symbols from the package wasysym.

yannisl
  • 117,160
  • 3
    your first example should increase the value for \arraystretch –  Jan 10 '12 at 06:33
  • 4
    This is a very good counter example to "the rule" about using horizontal rules. Some tables are just vertical and meant to be read that way (but then, they are usually quite long and dense, so I would put them on a dedicated page, which makes it ok not to blend well with the text flow). Thank you. – ienissei Jan 10 '12 at 10:14
  • @Herbert Thanks. I typed the sample very late last night; you right it can do with a bit more space:) – yannisl Jan 10 '12 at 12:23
  • 5
    What are "Firer's Rules"? – mbork Aug 08 '16 at 07:23