2

I couldn't find this anywhere else. I have an array with a bunch of numbers in it, and I am very new to posting on this forum.

This is from a template that I have to use for a document. Here's the code for the table. What I want is that last column to only have a box around the bottom right number. How can I do that?

\begin{table}[tbp]
    \[ 
    \begin{array}{c | c | c | c | c | c | }
    \multicolumn{1}{c}{ j } & \multicolumn{1}{c}1 & \multicolumn{1}{c}2 & 
    \multicolumn{1}{c}4 & \multicolumn{1}{c}7 & \multicolumn{1}{c}{\text{max}} \\
    \cline{2-6}
    1 & 1 & 2 & 4 & 7 & 7 \\
     \cline{2-6}
    2 & 2 & 4 & 8 & 2 & 8 \\
     \cline{2-6}
    3 & 3 & 6 & 4 & 5 & 6 \\
     \cline{2-6}
    4 & 4 & 8 & 8 & 4 & 8 \\
     \cline{2-6}
    5 & 5 & 6 & 4 & 3 & 6 \\
     \cline{2-6}
    6 & 6 & 4 & 8 & 6 & 8 \\
     \cline{2-6}
    7 & 7 & 2 & 4 & 1 & 7 \\
     \cline{2-6}
    8 & 8 & 0 & 0 & 8 & 8 \\
     \cline{2-6}
    \text{min} &  &  &  &  & 7 \\
     \cline{6-6} 
\end{array}
\]
\end{table}

Here's the picture of whta it's generating.

Table of numbers

  • 1
    Hello, your sample doesn't compile. Please provide a minimal working example next time. :-) – frougon Apr 3 at 8:53
2

Here is one possibility:

\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}
\[
  \begin{array}{c|c|c|c|c|c}
    \multicolumn{1}{c}{ j } & \multicolumn{1}{c}1 & \multicolumn{1}{c}2 & 
    \multicolumn{1}{c}4 & \multicolumn{1}{c}7 & \multicolumn{1}{c}{\text{max}} \\
    \cline{2-5}
    1 & 1 & 2 & 4 & 7 & 7 \\
     \cline{2-5}
    2 & 2 & 4 & 8 & 2 & 8 \\
     \cline{2-5}
    3 & 3 & 6 & 4 & 5 & 6 \\
     \cline{2-5}
    4 & 4 & 8 & 8 & 4 & 8 \\
     \cline{2-5}
    5 & 5 & 6 & 4 & 3 & 6 \\
     \cline{2-5}
    6 & 6 & 4 & 8 & 6 & 8 \\
     \cline{2-5}
    7 & 7 & 2 & 4 & 1 & 7 \\
     \cline{2-5}
    8 & 8 & 0 & 0 & 8 & 8 \\
     \cline{2-6}
    \text{min} &  &  &  &  & \multicolumn{1}{|c|}{7} \\
     \cline{6-6}
  \end{array}
\]
\end{document}

enter image description here

1

Is it like the following?

\documentclass{article}
\usepackage{amsmath,array}

\begin{document}

\[ 
\begin{array}{c | c | c | c | c | c }
\multicolumn{1}{c}{j} & \multicolumn{1}{c}{1} & \multicolumn{1}{c}{2} & 
\multicolumn{1}{c}{4} & \multicolumn{1}{c}{7} & \multicolumn{1}{c}{\max} \\
\cline{2-5}
1 & 1 & 2 & 4 & 7 & 7 \\
 \cline{2-5}
2 & 2 & 4 & 8 & 2 & 8 \\
 \cline{2-5}
3 & 3 & 6 & 4 & 5 & 6 \\
 \cline{2-5}
4 & 4 & 8 & 8 & 4 & 8 \\
 \cline{2-5}
5 & 5 & 6 & 4 & 3 & 6 \\
 \cline{2-5}
6 & 6 & 4 & 8 & 6 & 8 \\
 \cline{2-5}
7 & 7 & 2 & 4 & 1 & 7 \\
 \cline{2-5}
8 & 8 & 0 & 0 & 8 & 8 \\
 \cline{2-6}
\multicolumn{1}{c}{\min} & \multicolumn{4}{c|}{} & \multicolumn{1}{c|}{7} \\
 \cline{6-6}
\end{array}
\]

\end{document}

enter image description here

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.