Table in Latex

Here reported the code for a simple table in \LaTeX:

\begin{table}[h]
  \begin{center}
    \begin{tabular}{|c|c|c|}
      \hline Rows  & Columns 1 & Column 2} \\
      \hline Row 1 & Value 1,1 & Value 2,1 \\
      \hline Row 2 & Value 1,2 & Value 2,2 \\
      \hline Row 3 & Value 1,3 & Value 2,3 \\
      \hline Row 4 & Value 1,4 & Value 2,4 \\ \hline
    \end{tabular}
    \caption[Short title for contains]{Description of table content}
    \label{label_of_choice}
  \end{center}
\end{table}

We the command \begin{tabular} we position the table within the the float environment table at which we add the position between [] (h, t, b, etc).

The command \begin{center} or the alternative \centering will position the table in the middle of the page.

\begin{tabular} starts the table itself. We can decide the number n of columns adding bars ‘|’ within the braces {}, to which has always to correspond a number of ‘&’ of n-1

The caption has to be insert between tabular and table.

Today over the internet are present many online tools for the creation of tables.
Such websites are quite handy, and it is easy to produce complex tables.

My favourite one is: tablesgenerator

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s