About the LaTeX Table Generator
Paste rows copied from a spreadsheet, a CSV export or a pipe separated block and this tool writes the LaTeX for you: the column specification, the ampersands between cells, the double backslash that ends every row and the rules in between. Quoted CSV fields are parsed properly, and short rows are padded so the column count stays consistent, which is the mistake LaTeX reports as an extra alignment tab error.
Booktabs rules are on by default because that is what a well typeset table uses: a top rule, a mid rule under the header, a bottom rule, and no vertical lines at all. Add the booktabs package to your preamble, which the output reminds you to do. Turning the option off falls back to plain horizontal rules, and the vertical lines switch inserts pipes into the column specification for anyone who needs the boxed look their department template demands.
Cell text is escaped, so ampersands, percent signs, underscores, dollar signs and braces arrive as literal characters instead of derailing the compile. The automatic alignment setting inspects each column and right aligns the ones holding only numbers, which is the usual convention for figures and makes decimal points line up. The float wrapper adds the table environment with a caption and a label so you can point at it with a cross reference. For the same data as a web table, use the HTML Table Generator.
How to use
- Paste your rows, or press Sample to see the format.
- Say whether the first row is a header, and pick the alignment.
- Keep booktabs on for a clean rule style, and add a caption and label.
- Copy the LaTeX into your document and add the booktabs package.
Common questions
- What does the booktabs package add?
- It provides toprule, midrule and bottomrule commands with better spacing and weight than plain horizontal lines.
- Why does my table fail to compile?
- Usually a row has a different number of cells, or an unescaped character. This tool pads rows and escapes reserved characters for you.
- How do I reference the table later?
- Keep the float wrapper and set a label, then point at it with a ref command in your text.
- Can I get columns of a fixed width?
- Choose the paragraph alignment, which uses a p column so long cell text wraps instead of running off the page.