How can I stop my table in latex to start unnecessarily from next page leaving a huge space in previous page? How can I force to start just after the heading. Here is my code:
I am using packages:
\usepackage{tabularx,ragged2e,booktabs,caption},
\usepackage{float}
and the code for my table is:
\begin{table}[H]
\begin{tabular}{| l| l }
$.$ & Matches any character.\\
$*$ & Matches zero or more instances of the previous pattern item.\\
$+$ & Matches one or more instances of the previous pattern item.\\
$?$ & Matches zero or one instances of the previous pattern item.\\
$( )$ & Groups a subpattern. The repetition and alternation operators apply to the preceding subpattern.\\
$|$ & Alternation.\\
$[ ]$ & Delimit a set of characters. Ranges are specified as [x-y].\\
\textasciicircum & Anchor the pattern to the beginning of the string. Only when first.\\
\$ & Anchor the pattern to the end of the string. Only when last.\\
\end{tabular}
\end{table}
I tried [!ht]
, [!htp]
and [htpb]
nothing of that sort works instead the table vanishes.
Not only in the case that your table is too long to vertically fit into the page (e.g. below a header or some text paragraph), you can switch from the float approach to:
When compiled, this looks exactly like your
table
, provided you include\usepackage{longtable}
in your preamble (andlongtable
s are not floats, whiletable
s are).