# to vertically align text in center in table when other cells are rotated

I am trying to move first cell text "Assembly" to the center of cell. I already tried raisebox, parbox and many more things but nothing worked. Please help me. And, I don't want to change the rotation of other cells.

    \newcommand*\rot{\rotatebox{90}}
\begin{table}[h!]
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
Assembly & \rot{Contigs} & \rot{Largest contig} & \rot{Total length} &
\rot{Misassemblies} & \rot{Local misassemblies} & \rot{Mismatches per 100KB} &
\rot{N50} & \rot{Predicted genes} & \rot{Genome fraction (\%)}\\
\hline
\end{tabular}
\end{table} ## 2 Answers

Using a multirow with a height correction works. I removed the \arraystretch=1.4 as it didn't do anything here (maybe you need it for your real table) and used \multirowcell from the makecell package, as the syntax is slightly simpler, and the package has commands to add vertical padding to cells (\gape'…}).

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{makecell}
\newcommand*\rot{\rotatebox{90}{#1}}

\begin{document}

\begin{table}[h!]
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\multirowcell{1}[11ex]{Assembly}& \rot{Contigs} & \rot{Largest contig} & \rot{Total length} &
\rot{Misassemblies} & \rot{Local misassemblies} &\gape[t]{\rot{Mismatches per 100KB}} &
\rot{N50} & \rot{Predicted genes} & \rot{Genome fraction (\%)}\\
\hline
\end{tabular}
\end{table}

\end{document} • Rather than \newcommand*\rot{\rotatebox{90}}, I'd write \newcommand*\rot{\rotatebox{90}{#1}}. – Mico Mar 29 '16 at 9:57
• @Mico: I reused the O.P.'s code for this one, but it works. Is there any drawback? – Bernard Mar 29 '16 at 10:00
• The OP's code for the \rot macro just happens to work as (a) the underlying \rotatebox macro expects two arguments and (b) \rot is being followed by a braces-delimited expression in all instances. The main advantage, in my view, of specifying explicitly that \rot takes exactly one argument is that it simplifies debugging, should a user ever forget to provide an argument for \rot. – Mico Mar 29 '16 at 10:17
• I see. 'Tis corrected. Thanks for the information! – Bernard Mar 29 '16 at 10:36

Instead of \rotatebox{90} you can use \rotatebox[origin=c]{90} to rotate boxes around their centers

\documentclass[12pt]{article}
\usepackage{graphicx}

\begin{document}

\newcommand*\rot{\rotatebox[origin=c]{90}}
\begin{table}[h!]
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
Assembly & \rot{Contigs} & \rot{Largest contig} & \rot{Total length} &
\rot{Misassemblies} & \rot{Local misassemblies} & \rot{Mismatches per 100KB} &
\rot{N50} & \rot{Predicted genes} & \rot{Genome fraction (\%)}\\
\hline
\end{tabular}
\end{table}

\end{document}
{"ft_lang_label":"__label__en","ft_lang_prob":0.60805446,"math_prob":0.6265532,"size":3126,"snap":"2021-21-2021-25","text_gpt3_token_len":1000,"char_repetition_ratio":0.13164638,"word_repetition_ratio":0.21686748,"special_character_ratio":0.28662828,"punctuation_ratio":0.06122449,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9514632,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-06-12T21:24:08Z\",\"WARC-Record-ID\":\"<urn:uuid:34d7a3da-39c6-4de6-ae67-655faa72d50f>\",\"Content-Length\":\"178998\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:19f8c2cb-9db9-4979-ae7d-7e3d5420d57e>\",\"WARC-Concurrent-To\":\"<urn:uuid:f22a5fc9-9ed3-4334-baec-4294899a9a8a>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://tex.stackexchange.com/questions/301333/to-vertically-align-text-in-center-in-table-when-other-cells-are-rotated\",\"WARC-Payload-Digest\":\"sha1:NJHBAEFRBQQMYM7NKTDOCRYXYPPPFMEU\",\"WARC-Block-Digest\":\"sha1:XHLMENKFEC7RJ3RKXOFVR6UGQ52YMAO5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-25/CC-MAIN-2021-25_segments_1623487586390.4_warc_CC-MAIN-20210612193058-20210612223058-00513.warc.gz\"}"}