4
\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?...

User
  • 241
  • 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 03:28

2 Answers2

4

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.

cfr
  • 198,882
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 03:34
  • @cfr: We call it mudra raakshsasha aka typo ;) –  Oct 26 '14 at 03: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 03:47