Graphics, Figures & TablesBasic Table fails

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
algebraicTopology
Posts: 1
Joined: Fri Feb 08, 2013 9:51 pm

Basic Table fails

Post by algebraicTopology »

I am just trying to build an incredibly simple table and used this code:

Code: Select all

\begin{table}
    \begin{tabular}{|l|l|l|l|l|l|}
    \hline	
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    1 & 1 & 1 & 1 & 1 & 1 \\ \hline
    \hline
  \end{tabular}
\end{table}
However, when I build with those first and last \hline, it gives errors, doesn't put in the line, and in the top let box writes "height1". If I take out the top and bottom \hline it builds fine, but of course I don't get my desired horizontal lines. I am stumped and feel this is the simplest thing ever I am not seeing.
Last edited by localghost on Fri Feb 08, 2013 10:38 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Basic Table fails

Post by localghost »

No problem here.

Code: Select all

\documentclass{article}

\begin{document}
  \begin{table}
    \begin{tabular}{|l|l|l|l|l|l|}
      \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      1 & 1 & 1 & 1 & 1 & 1 \\ \hline
      \hline
    \end{tabular}
  \end{table}
\end{document}
So please prepare a self-contained and minimal example that clearly reproduces the error to give an adequate problem description. And the exact error message(s) from the log file (*.log) could also be helpful.


Best regards and welcome to the board
Thorsten
Post Reply