3
\begin{tabular}{|c|c|c|c|c|c|}
\hline
x&x& & & & \\
\hline
 &x&x& & & \\
\hline
 & &x& & & \\
\hline
 & & & &x&x\\
\hline
 & & & & &x\\
\hline
 & & & & & \\
\hline
\end{tabular}

With the above script, since I don't have any check mark on the fourth column, I get a smaller width on that column... Can any body fix this problem?...

  • Always post a complete, small document rather than a mere code fragment - it is much more useful to those trying to help. – cfr Oct 26 '14 at 3:28
3

Define a new column

\documentclass{article}
\usepackage{array}
\newcolumntype{C}{>{\centering\arraybackslash}p{1em}}
\begin{document}
  \begin{tabular}{|*{6}{C|}}
\hline
x&x& & & & \\
\hline
 &x&x& & & \\
\hline
 & &x& & & \\
\hline
 & & & &x&x\\
\hline
 & & & & &x\\
\hline
 & & & & & \\
\hline
\end{tabular}
\end{document}

enter image description here

  • Is there an Article class? – cfr Oct 26 '14 at 3:34
  • @cfr: We call it mudra raakshsasha aka typo ;) – user11232 Oct 26 '14 at 3:44
  • Too bad. I hoped it was an exciting new class which would make the tea. (It looks easier to create meta-typos when typing 'typo' in your language. Sorry but I do not know what it is. I'm not very good on languages. :() – cfr Oct 26 '14 at 3:47
2

You can set the column width with the p column type. To retain the centring, you need to add this manually, however, as the column will be left aligned by default. (You could define a new column type but since the columns are all identical, there is not much to be gained from doing so.)

\documentclass{article}
\usepackage{array}
\begin{document}
  \begin{tabular}{|*{6}{>{\centering\arraybackslash}p{.05\linewidth}|}}
    \hline
    x&x& & & & \\
    \hline
    &x&x& & & \\
    \hline
    & &x& & & \\
    \hline
    & & & &x&x\\
    \hline
    & & & & &x\\
    \hline
    & & & & & \\
    \hline
  \end{tabular}
\end{document}

grid with evenly sized cells

Adjust the width of the columns to whatever you prefer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.