# How set the format of the cell in the table

I want symbols in the example column in the center Also, in the first column, the width of ^ and the width of | are not the same as others. Does anyone have ideas? Thanks!

• Welcome to TeX.se. Instead of just posting images of the output, can you edit your question to show a minimal compilable document to show what you're doing. – Alan Munn May 6 '18 at 16:21
• I'd suggest you use 7 columns for the table, three (right, center and left aligned) for the symbol, one for the description and another three for the example. That way you can easily achieve the alignment shown in the second image – leandriis May 6 '18 at 16:39
• Yes, you are right. I also want to do that. Thank you – dq.shen May 7 '18 at 13:38

Here's a solution that employs an array environment and some custom column types for math and text material, resp.

\documentclass{article}
\usepackage{array} % for '\newcolumntype' macro
\newcolumntype{C}{>{{}}c<{{}}}  % for centered math operators
\newcolumntype{L}{>{$\itshape}l<{$}}
\newcolumntype{R}{>{$\itshape}r<{$}}
\newcolumntype{t}{>{$}c<{$}} % centered text material
\usepackage{amsmath,  % for '\text' macro
amssymb,  % for '\sqsubset' macro
booktabs} % for '\midrule' macro
\begin{document}
$\setlength\arraycolsep{0pt} \begin{array}{rCl @{\qquad} t @{\qquad} RCL} \multicolumn{3}{l}{\text{symbol}} & name & \multicolumn{3}{c}{\text{example}} \\ \midrule x &\equiv& y & equivalence & bike &\equiv& bicycle \\ x &\sqsubset& y & forward entailment & crow &\sqsubset& bird \\ & & & \vdots \\ x &|& y & alternation & elephant &|& duck \\ & & & \vdots \\ x &\#& y & independence & hungry &\#& hippo \\ \end{array}$
\end{document}

• Thank you very much. I also figure our another way, that is make the example into three column. Do you think that is a right way? – dq.shen May 7 '18 at 13:37
• @dq.shen - Not knowing how your 3-column solution is defined (my answer has 7 columns...), I'm afraid I'm not in a position to judge what's "right". In general, is a solution works, it can't be too wrong... – Mico May 7 '18 at 14:08