5
\documentclass{article}
\usepackage[letterpaper]{geometry}  
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage[spanish]{babel} 
\usepackage{tabularx}
\usepackage{array}
\usepackage{adjustbox}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{multirow}
 \usepackage{caption}
\graphicspath{ {images/} }
\special{papersize=8.5in,11in}
\usepackage{float}
\usepackage{multicol}
\usepackage[caption = false]{subfig}
\usepackage{geometry}

\begin{table}[h!]
\centering
\begin{tabular}{|c c|}
\hline
    Parameter & Intensity [mW] \\ 
 \hline \hline 
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
\end{tabular}
    \caption{Intensidades}
    \label{intSt}
 \end{table}

When I remove \begin{table} & \end{table} the tables does appear, however I cant add \caption or \label. Does anyone knows how to make the table appear with \begin{table} & \end{table}?

Mico
  • 506,678
Ivan
  • 161
  • 2
    Welcome to TeX.SE! The table is there on my machine after adding \begin{document} and \end{document}. –  Feb 19 '18 at 03:41
  • I got the same results as @marmot - are you sure it's disappeared and not moved? – Au101 Feb 19 '18 at 03:42
  • 100% sure, I use \ref{insSt} somewhere else and it appears as: '??', just as if the table didnt exists – Ivan Feb 19 '18 at 03:45
  • I also began a new documment and it works, very stange! – Ivan Feb 19 '18 at 03:48
  • Ohhhh, we thought you were talking about the whole table itself, not the reference. Have you compiled twice? – Au101 Feb 19 '18 at 03:49
  • actually the whole table disappears, the ref was just a 'confirmation' that it wasnt placed anywhere else – Ivan Feb 19 '18 at 03:49
  • There are now two contradicting statement, "I also began a new documment and it works..." and "actually the whole table disappears...". Which one is correct? –  Feb 19 '18 at 03:53
  • the whole table disappears in the original document, but when I create a new document and copy-paste the code, it appears just fine.. – Ivan Feb 19 '18 at 03:56
  • I believe the problem is related to the use of: \begin{multicols}{2} \end{multicols{2} – Ivan Feb 19 '18 at 04:04
  • that is why every question should have an example of the problem, nothing in the code you posted is related to the problem or the answer. – David Carlisle Feb 19 '18 at 07:53
  • 2
    If you put a table inside a multicols environment the .log file will tell you that Package multicol Warning: Floats and marginpars not allowed inside 'multicols' environment!. – Torbjørn T. Feb 19 '18 at 08:06

2 Answers2

2

I am unable to replicate the problem you describe once I add the instructions \begin{document} and \end{document} to your code. I can only assume (and hope...) that the table which you're actually trying to typeset different from the "dummy" table you posted.

At any rate, I'd make an effort to improve the intelligibility of the table, say, by omitting all \hline directives and, instead, loading the booktabs package and drawing far fewer, but well-spaced lines. Switching from a tabular to an array environment would improve the readability of the code, by allowing a serious reduction in the number of $ symbols used throughout the table.

enter image description here

\documentclass{article}
\usepackage[letterpaper]{geometry}  
\usepackage[utf8]{inputenc}
\usepackage{blindtext} % do you really need this?
\usepackage[spanish]{babel} 
\usepackage{tabularx}
%%\usepackage{array} % is loaded automatically by 'tabularx'
\usepackage{adjustbox} % do you reall need this package?
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{multirow}
%%\usepackage{caption}
\graphicspath{ {images/} }
%%\special{papersize=8.5in,11in}
\usepackage{float}
\usepackage{multicol}
%%\usepackage[caption = false]{subfig}
%%\usepackage{geometry}
\usepackage{booktabs} % <-- new
\begin{document}

\begin{table}[h!]
\centering
$\begin{array}{@{}cc@{}}
  \toprule
  $Parameter$ & $Intensity [mW]$ \\ 
  \midrule 
  I_0(0,0) & 0.23 \\
  I_1(0,0) & 0.23 \\
  I_2(0,0) & 0.23 \\[0.75ex] 
  I_4(0,0) & 0.23 \\ 
  I_4(0,0) & 0.23 \\ 
  I_5(0,0) & 0.23 \\
  \bottomrule
\end{array}$
\caption{Intensidades}\label{intSt}
 \end{table}

\end{document}
Mico
  • 506,678
  • 1
    so far i didn't see the use $Parameter$ & $Intensity [mW]$ \\ for making Parameter and Intensity [mW] normal text. is this somewehere described? – Zarko Feb 19 '18 at 09:57
  • @Zarko - Since I'm using an array environments, the contents of a c-type column is in math mode by default. Writing $Parameter$ exits math mode at the start and re-enters it at the end of the cell. Another way to achieve the objective of rendering "Parameter" in text mode would be to input it as \mbox{Parameter} -- 5 keystrokes more than $Parameter$... – Mico Feb 19 '18 at 10:19
  • thank you very much. i suspect this, but i was not sure, if this is allowed. good to know :-) – Zarko Feb 19 '18 at 10:31
  • @Zarko: Ah... I will remove my comment then. –  Feb 19 '18 at 14:00
1

fixed using:

    \begin{wraptable}{l}{0.7\linewidth}
    \centering
    \begin{tabular}{|c | c|}
    \hline
    Parámetros & Intensidades [mW] \\ 
    \hline  
    $I(0,0)$ & $0.23$ \\
     $I(\frac{\pi}{4},0)$ & $0.25$ \\
     $I(\frac{\pi}{2},0)$ & $0.27$ \\
     $I(\frac{3\pi}{4},0)$ & $0.26$ \\
     $I(\frac{\pi}{4},\frac{\pi}{2})$ & $0.23$ \\
     $I(\frac{3\pi}{4},\frac{\pi}{2})$ & $0.23$ \\
     \hline
    \end{tabular}
         \caption{Intensidades}
          \label{intSt}
\end{wraptable}
Sebastiano
  • 54,118
Ivan
  • 161
  • 2
    how is your answer related to your question? please first make your code example in question as well in answer compilable. – Zarko Feb 19 '18 at 04:22