I have this code for a table...
\documentclass[11pt,a4paper]{article}
\usepackage[margin=20mm]{geometry}
\usepackage{rotating}
\usepackage{float}
\newcommand*\rot[1]{\rotatebox{90}{#1}}
\usepackage{tabularx}
\renewcommand{\arraystretch}{1.5}
\begin{document}
\begin{table}[H]
\begin{tabularx}{\textwidth}{|XXXXXXXXXXXX|}
\hline
\multicolumn{3}{|X|}{Design Table for: Coursework Candidate\_Name} & & & & & & & & & \\
\hline
\multicolumn{1}{|X|}{} & \multicolumn{1}{X|}{Shaft Diameter} & \multicolumn{1}{X|}{Max Torque} &
\multicolumn{1}{X|}{Outer Flange Diameter} & \multicolumn{1}{X|}{Flange Base Depth} & \multicolumn{1}{X|}{Inner Flange Diameter} & \multicolumn{1}{X|}{Flange Boss Depth} & \multicolumn{1}{X|}{Pitch Centre Diameter} & \multicolumn{1}{X|}{Number of Holes} & \multicolumn{1}{X|}{Hole Diameter} & \multicolumn{1}{X|}{Key Way Width} & \multicolumn{1}{X|}{Key Way Depth} \\
\hline
\multicolumn{1}{|l|}{} & \multicolumn{1}{l|}{\rot{D1@Sketch4}} & \multicolumn{1}{l|}{} &
\multicolumn{1}{l|}{\rot{D1@Sketch1}} & \multicolumn{1}{l|}{\rot{D1@Boss-Extrude1}} &
\multicolumn{1}{l|}{\rot{D1@Sketch2}} & \multicolumn{1}{l|}{\rot{D1@Boss-Extrude2}} &
\multicolumn{1}{l|}{\rot{D1@Sketch3}} & \multicolumn{1}{l|}{\rot{D2@Sketch3}} & \multicolumn{1}{l|}{\rot{D3@Sketch3}} & \multicolumn{1}{l|}{\rot{D2@Sketch4}} & \multicolumn{1}{l|}{\rot{D3@Sketch4}} \\
\hline
\multicolumn{1}{|l|}{Default} & \multicolumn{1}{l|}{55} & \multicolumn{1}{l|}{240} & \multicolumn{1}{l|}{220} & \multicolumn{1}{l|}{27.5} & \multicolumn{1}{l|}{110} & \multicolumn{1}{l|}{27.5} & \multicolumn{1}{l|}{82.5} & \multicolumn{1}{l|}{9} & \multicolumn{1}{l|}{20} & \multicolumn{1}{l|}{6.875} & \multicolumn{1}{l|}{13.75} \\
\hline
\multicolumn{1}{|l|}{132M} & \multicolumn{1}{l|}{55} & \multicolumn{1}{l|}{240} & \multicolumn{1}{l|}{220} & \multicolumn{1}{l|}{27.5} & \multicolumn{1}{l|}{110} & \multicolumn{1}{l|}{27.5} & \multicolumn{1}{l|}{82.5} & \multicolumn{1}{l|}{9} & \multicolumn{1}{l|}{20} & \multicolumn{1}{l|}{6.875} & \multicolumn{1}{l|}{13.75} \\
\hline
\multicolumn{1}{|l|}{100L} & \multicolumn{1}{l|}{38} & \multicolumn{1}{l|}{135} & \multicolumn{1}{l|}{152} & \multicolumn{1}{l|}{19} & \multicolumn{1}{l|}{76} & \multicolumn{1}{l|}{19} & \multicolumn{1}{l|}{57} & \multicolumn{1}{l|}{6} & \multicolumn{1}{l|}{20} & \multicolumn{1}{l|}{4.75} & \multicolumn{1}{l|}{9.5} \\
\hline
\multicolumn{1}{|l|}{80L} & \multicolumn{1}{l|}{24} & \multicolumn{1}{l|}{24} & \multicolumn{1}{l|}{96} & \multicolumn{1}{l|}{12} & \multicolumn{1}{l|}{48} & \multicolumn{1}{l|}{12} & \multicolumn{1}{l|}{36} & \multicolumn{1}{l|}{6} & \multicolumn{1}{l|}{8} & \multicolumn{1}{l|}{3} & \multicolumn{1}{l|}{6} \\
\hline
\multicolumn{1}{|l|}{63S} & \multicolumn{1}{l|}{11} & \multicolumn{1}{l|}{10} & \multicolumn{1}{l|}{44} & \multicolumn{1}{l|}{5.5} & \multicolumn{1}{l|}{22} & \multicolumn{1}{l|}{5.5} & \multicolumn{1}{l|}{16.5} & \multicolumn{1}{l|}{3} & \multicolumn{1}{l|}{8} & \multicolumn{1}{l|}{1.375} & \multicolumn{1}{l|}{2.75} \\
\hline
\end{tabularx}
\end{table}
\end{document}
I wanted to know whether the code for the table can be improved (I'm unfamiliar with LaTeX tables) and also if the part saying 'Design table...' can be displayed nicer and currently it wraps, but it is too much wrapping. Also is there a better way to display the second row content?
{}
that makes latex to give it (informally) the argument that is missing. But someone who will try to use your code without knowing how \rotatebox command has to behave and its syntax, will not really understand the code and will possibly try to use it without the{}
.\multicolumn{3}{|X|}{Design Table for: Coursework Candidate\_Name}
is wrong. Consider writing\multicolumn{12}{|l|}{Design Table for: Coursework Candidate\_Name}
instead.