Error with Table position: [H] goes in label

I am trying to set up a document in Overleaf with \documentclass[12pt]{comjnl} where i need to have a table in the middle of some text.

The table does not react when i use the position parameter for here: [H!] or [h!]

The code looks like this:

\begin{table}[H!]
\centering
\begin{tabular}{lll}
Model                   & Parameters   & MAE \\
Linear Regression       & None/Default & 25.994              \\
Logistic Regression     &              &                     \\
Linear SVC              &              &                     \\
Random Forest Regressor & n\_estimators=10  & 15.739 \\
Decision Tree Rergessor &              &                     \\
XGBoost                 &              &
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table}


The [!H] ends up being shown in my table. Can anyone help me get the table to be placed correctly, without the [H!]?

• The H option is added by the float package. However, it might be better to let the table float and use references in the text (as already mentioned by JouleV). If you don't want the table to float, you could also remove the figure environment and ose \captionof from the caption package. – leandriis May 18 at 15:01
• For completeness' sake: this looks to be comjnl.cls which can be obtained from academic.oup.com/comjnl/pages/Manuscript_Preparation_Submission. Direct link: academic.oup.com/DocumentLibrary/comjnl/comjnl.cls.txt It looks like the class has re-defined floats, so optional parameters are no longer recognised. – LianTze Lim May 18 at 15:07
• @LianTzeLim oops I guess in that case you should post that as an answer and I'll delete mine, thanks for checking! – David Carlisle May 18 at 15:10
• Thanks @DavidCarlisle, will do that! – LianTze Lim May 18 at 15:16

This looks to be comjnl.cls, which can be obtained from https://academic.oup.com/comjnl/pages/Manuscript_Preparation_Submission. Direct link: https://academic.oup.com/DocumentLibrary/comjnl/comjnl.cls.txt
It looks like the class has re-defined tables and figures, so optional parameters are no longer recognised: this means the [H], [h] etc will just be considered as part of the table content. So you'll just have to let the floats float, per the journal's intentions.