\begin{table} makes table disappear

\begin{table} makes table disappear
\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}?

답변1

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}

답변2

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}

관련 정보