Tables

This document shows the four kinds of tables supported by Tufte-Blog. The tables in this document are adapted from those in the documentation for Pandoc and Tufte-Jekyll.

This is an example of a normal table. It is capable of stretching to take up the entirety of the text width in order to accommodate its contents.
Left Center Right
Aardvarks 1 $3.50
Cats 5 $4.23
Dogs 3 $5.29
This is an example of a table that is forced to take up the entirety of the text width.
mpg cyl disp hp drat wt
Mazda RX4 21 6 160 110 3.90 2.62
Mazda RX4 Wag 21 6 160 110 3.90 2.88
Datsun 710 22.8 4 108 93 3.85 2.32
Hornet 4 Drive 21.4 6 258 110 3.08 3.21
Hornet Sportabout 18.7 8 360 175 3.15 3.44
Valiant 18.1 6 160 105 2.76 3.46
This is an example of a table that is forced to take up the entirety of the page width.
Content and tone of front-page articles in 94 U.S. newspapers, October and November, 1974 Number of articles Percent of articles with negative criticism of specific person or policy
Watergate: defendants and prosecutors, Ford’s pardon of Nixon 537 49%
Inflation, high cost of living 415 28%
Government competence: costs, quality, salaries of public employees 322 30%
Confidence in government: power of special interests, trust in political leaders, dishonesty in politics 266 52%
Government power: regulation of business, secrecy, control of CIA and FBI 154 42%
Crime 123 30%
Race 103 25%
Unemployment 100 13%
Shortages: energy, food 68 16%
This table was created using Pandoc’s grid table syntax. It can contain arbitrary block elements, such as paragraphs, code blocks, lists, etc. However, it is not compatible with the fullwidth class. Neither the table nor its enclosing figure should be assigned the fullwidth class.
Fruit Price Advantages

Bananas

$1.34

  • built-in wrapper
  • bright color

Oranges

$2.10

  • cures scurvy
  • tasty

Unsupported Features

Tables like the following currently cannot be created without using raw HTML. This is because Pandoc does not yet support the rowspan and colspan attributes. Note that in order for raw HTML tables to correctly scroll on overflow, they should either (1) be fullwidth and contain a colgroup specifying the relative sizes of the columns, or (2) specify the table width (e.g. as a percentage of the parent width) using the style attribute.

Items
Animal Description Price ($)
Gnat per gram 13.65
each 0.01
Gnu stuffed 92.50
Emu stuffed 33.33
Armadillo frozen 8.99

In the future, it may be useful to allow the user to optionally specify a minimum width for each column of a table. Large tables like this one don’t look very good on small screens. One potential solution would be to scale the font size and line width according to the screen resolution and DPI. Experience leads me to believe this solution is currently unviable for the following reasons: (1) it’s seldom possible to obtain the true DPI; (2) it’s very difficult to fluidly vary the font size, line height, margins and paddings, etc., so that the page looks good across a diverse set of displays; and (3), there is a minimum font size beyond which the text becomes illegible, so each table column should have a minimum width in the first place.