2

I am very new to LaTeX so please excuse the amateur question. I am creating a table using the following commands:

\begin{table}[ht!]
\small
\centering
\caption{Effect of industry on \emph{Bad Self Impact} by value of \emph{Cultural Sentiment}}.
\begin{tabular}{|c|c|c|c|}\\ 
\hline
Value of \emph{Cultural Sentiment}  & Coefficient on \emph{Import Industry}  & P-value & Observations\\ \hline
Positive & 0.234 (-0.108, 0.577) & 0.179 & 1995\\ \hline
Neutral & 0.607 (0.267, 0.947) & 0.000 & 1040\\ \hline
Negative & -0.099 (-0.485, 0.288) & 0.616 & 703\\ \hline
\end{tabular}\\
\end{table}

But the result looks like this, with two lines on the top left of the table jutting out beyond its borders. How do I get rid of them?

enter image description here

  • not sure why my commands are all on one line, by the way. that is not how i entered them in the compiler. – Shayda Mar 19 '14 at 17:35
  • 4
    delete the \\ after \begin{tabular} – David Carlisle Mar 19 '14 at 17:35
  • 1
    Welcome to tex.sx, when adding code sections highlight them and use the {} button in the editor which formats them in a text block (see my edit). – David Carlisle Mar 19 '14 at 17:37
  • @DavidCarlisle an answer? :) – cmhughes Mar 19 '14 at 19:00
2

Delete the \\ after \begin{tabular} It is causing an empty row ended after the first cell, which explains the vertical lines.

You should also delete the \\ after the \end{tabular} (\\ outside alignments are almost always wrong)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.