1

See the following MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=0.50in, right=0.50in, top=0.50in, bottom=0.50in]{geometry}
\begin{document}
    \begin{tabular}{|c|c|c|c|c|c|c|c|}
        \hline
        Number & 1      & 2       & 3         & 4        & 5      & 6        & 7      \\ \hline
        Day    & Monday & Tuesday & Wednesday & Thursday & Friday & Saturday & Sunday \\ \hline
    \end{tabular}
\end{document}

Question:1 How can i adjust vertical alignment for all cells in given table, i mean vertically centered.

Question:2 How can i increase a length (width)of particular row or column?

Zarko
  • 296,517
SandyM
  • 2,757
  • (i) in your table contents of all cells is vertical centered (ii) all rows always have the same length (ii) width of particular column you can set by column type p{<desired width>}. – Zarko Mar 04 '18 at 08:36
  • Please be more specific about your ultimate objective in question 2. What are you trying to achieve? E.g., would you like to make the seven data columns equally wide? Or are you looking to change the width of just one column? If so, which one? – Mico Mar 04 '18 at 08:37
  • by the way: basic of table settings you can find here: https://en.wikibooks.org/wiki/LaTeX/Tables – Zarko Mar 04 '18 at 08:40

1 Answers1

1

Not sure if this is what you're looking for...

With \renewcommand*{\arraystretch}{1.3} from array package you can fine tune your row height, an alternative is extrarowheight, see here: extrarowheight vs arraystretch.

To set a column to a given width, with text vertically centered, you could use an m column, see here: p,m and b columns in tables.

With >{\centering\arraybackslash}m{...} you have columns centered both vertically and horizontally. For convenience, I created a M column type:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[left=0.50in, right=0.50in, top=0.50in, bottom=0.50in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{array}
\renewcommand*{\arraystretch}{1.3}% increase the row height 
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

\begin{document}
\begin{center}\small
    \begin{tabular}{|c|*7{M{5em}|}}
        \hline
        Number & 1      & 2       & 3         & 4        & 5      & 6        & 7      \\ \hline
        Day    & Monday & Tuesday & Wednesday & Thursday & Friday & Saturday & Sunday \\ \hline
    \end{tabular}
\end{center}
    I added this this just to show how \verb|m| colums work:
\begin{center}\small    
    \begin{tabular}{|c|*7{M{5em}|}}
        \hline
        Number & 1      & 2       & 3         & 4        & 5      & 6        & 7      \\ \hline
        Day    & Monday This lines is just to show the vertical alignment & Tuesday & Wednesday & Thursday & Friday & Saturday & Sunday \\ \hline
    \end{tabular}
\end{center}
\end{document}

enter image description here

Zarko
  • 296,517
CarLaTeX
  • 62,716