LaTeX tables: Example 1

Example 2 Example 3 other reference

LaTeX Source

\begin{tabular}{|c|ccc|r|}
	\hline
$k$ &  $x_1^k$    &   $x_2^k$  & $x_3^k$   & remarks  \\
	\hline
0   & -0.3 & 0.6 & 0.7  &  \\
1   & 0.47102965 & 0.04883157 & -0.53345964  & *\\
2   & 0.49988691 & 0.00228830 & -0.52246185 & $s_3$ \\
3   & 0.49999976 & 0.00005380 & -0.52365600  & \\
4   & 0.5 & 0.00000307 & -0.52359743  & $\epsilon < 10^{-5}$ \\
7   & 0.5 & 0 & -0.52359878  & $\epsilon < \xi $ \\
	\hline
\end{tabular}

Compiled result

Notes

The parameter in the command \begin{tabular}{param} consists of letters c, l and r, to indicate how each column should be aligned -- centered, left-aligned, or right-aligned. Optionally, one or two vertical bars (| or ||) can be placed between those letters to show where single or double vertical lines should separate columns.

The character & is used to separate the contents of cells in a row, and a double backslash \\ ends each row.

The macro \hline is used before and/or after a row to produce a horizontal line across the table.