\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
DEC&0&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15\\
\hline
BIN&0000&0001&0010&0011&0100&0101&0110&0111&1000&1001&1010&1011&1100&1101&1110&1111\\
\hline
HEX&0&1&2&3&4&5&6&7&8&9&A&B&C&D&E&F
\end{tabular}
\end{document}
Asked
Active
Viewed 42 times
1
Alex Madsen
- 23
- 4
1 Answers
2
you need to specify as many columns
cas your table has columns. In your example, two were missingyou could decrease the
tabcolsepa bit to make your table more compact (this is explained in more detail in https://tex.stackexchange.com/a/332903/36296)
\documentclass{article}
\usepackage{geometry}
\begin{document}
\begingroup
\scriptsize
\setlength{\tabcolsep}{3pt}
\begin{tabular}{|*{17}{c|}}
DEC&0&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15\
\hline
BIN&0000&0001&0010&0011&0100&0101&0110&0111&1000&1001&1010&1011&1100&1101&1110&1111\
\hline
HEX&0&1&2&3&4&5&6&7&8&9&A&B&C&D&E&F
\end{tabular}
\endgroup
\end{document}
samcarter_is_at_topanswers.xyz
- 158,329


\smallbefore it (impossible to say as you have provided no information about your page or font sizes) – David Carlisle Feb 07 '24 at 11:37documentenvironment. – samcarter_is_at_topanswers.xyz Feb 07 '24 at 11:56\begin{tabular}{\textwidth}{...}is just wrong. – samcarter_is_at_topanswers.xyz Feb 07 '24 at 11:58c's does not match the number of your columns. You should get an error about this. – samcarter_is_at_topanswers.xyz Feb 07 '24 at 12:06Thank you, samcarter_is_at_topanswers.xyz
Correct number og 'c's fixed the problem.
– Alex Madsen Feb 07 '24 at 12:08! Extra alignment tab has been changed to \cr.– samcarter_is_at_topanswers.xyz Feb 07 '24 at 12:11