# Center text in table, vertically

In this image, since there are no characters like g,y in the first cell, there seems to be a misalignment between the round brackets and the text CBSE. Is there any way to automatically center text like the following image? I edited the following in GIMP and moved the text CBSE slightly down, to align it vertically. Is there any way to do the same in LaTeX?

Code snippet from my class file

\begin{tabular}{|M{0.295\textwidth}|c|c|c|}
\hline
Program & Institute & Percent/CGPA & Year of Completion \\
\hline
#1 & #2 & #3 & #4
\hline
\end{tabular}

• Please add some example code (MWE) to help us help you. Jul 18, 2017 at 8:38
• Added the code snippet from the class file. #1, #2, #3, #4 are filled in the main TeX file. Here, #2 is XII (CBSE) Jul 18, 2017 at 8:47
• You replace one problem with another: it quite visible that XII and CBSE are not aligned. Jul 18, 2017 at 9:49
• Hi, the intended behavior was that if a cell was completely without bottom glyphs as in g,y, it should center the entire cell's contents. I was too lazy and just moved the CBSE alone. Jul 18, 2017 at 9:52

## 2 Answers

This is not a bug. It is the intended behaviour. The parentheses account for possible descenders.

\documentclass{article}
\begin{document}
(CBSE)
\end{document}


If you want to adjust vertical alignment use \raisebox.

\documentclass{article}
\begin{document}
\raisebox{.1333ex}{(}CBSE\raisebox{.1333ex}{)}
\end{document}


• Is there a way to eliminate the space automatically if there are no descenders in a word? Jul 18, 2017 at 9:04
• @KarthikNishanth No, unless you are willing to write something like \parenthesize{CBSE}. Jul 18, 2017 at 9:10

You can obtain this result using small caps in a larger font, adding some negative kerning if you're perfectionist:

\documentclass{article}

\begin{document}

XII (CBSE)

\large\textsc{xii \kern-0.1em(\kern-0.07em cbse\kern-0.05em)}

\Large\textsc{xii (cbse)}

\end{document}