I'm trying to add a table to my IEEE paper but its width is too much. Please help me fix the width to make it fit.
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
.
.
.
.
\begin{table}[h!]
\centering
\begin{tabularx}{0.3\textwidth}{|c c c c c c|}
\hline
Feature 1 & Feature 2 & Accuracy & Precision & Recall & Specificity \ [0.5ex]
\hline\hline
original dna size & compressed dna size & 0.999 & 0.999 & 0.999 & 0.999 \
\hline
original dna size & compression ratio & 0.999 & 0.999 & 0.999 & 0.999 \ [1ex]
\hline
\end{tabularx}
\caption{caption}
\label{tab:my_label}
\end{table}
.
.
.
.
\end{document}


tabularxyou need to use at least one column that usesXto reach the total width goal, without anX-type columntabularxis just atabularwith extra input. – Skillmon Dec 11 '21 at 08:23Accuracy,Precision, etc. will store numbers, so you might want to use a column type that neatly aligns numbers, like theS-type provided bysiunitx. – Skillmon Dec 11 '21 at 08:25c-column use anXcolumn, but that won't solve things for you here, it'll just look terrible. – Skillmon Dec 11 '21 at 08:260.3\textwidthwide? Also, could you please post a compilable example (your code misses\documentclass,\begin{document},\end{document}, and the required packages to compile (in this case onlytabularx). – Skillmon Dec 11 '21 at 08:28xxxwould be good as well, are the four following columns all numeric? The closer your MWE is to your actual document (while keeping it minimal, so no need to add text, just make your table closer to the real thing, no need to use your real data, just something close to it) the better we can suggest stuff. – Skillmon Dec 11 '21 at 08:34\BibTeX: Don't use\rmand\sc, those macros are deprecated/unsupported by LaTeX since more than a decade! Instead use\rmfamilyand\scshape. – Skillmon Dec 11 '21 at 08:36