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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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