这就是我要的!
但是我的代码不起作用,它看起来像这样
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage[spanish,es-tabla]{babel} % espanol
\decimalpoint
\usepackage[utf8]{inputenc}
\usepackage{graphicx} % graficos
\usepackage{amsmath}
\usepackage{listings}
\usepackage{tikz} %era para hacer los grafos pero no investigué mucho asi que lo hice con word
\usetikzlibrary{arrows}
%Header an Footer Stuff
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[R]{ \thepage\ }
%Hyperlink
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\hypersetup{colorlinks=false}
\hypersetup{pdfborder={0 0 0}}
\begin{document}
\begin{table}[htbp]
\caption{Valores optimos Ejercicio 2}
\begin{tabular}{| l | l | l | l | l | l | l | l | l | l | l | l | l | l | l | l | l |}
\hline
$x_{ij}$ & 1-2 & 1-3 & 1-5 & 2-3 & 2-4 & 2-8 & 3-4 & 3-5 & 4-7 & 4-8 & 5-6 & 5-9\\
\hline
Valor & 30 & 15 & 14 & 7 & 7 & 16 & 12 & 10 & 7 & 12\\
\hline
\end{tabular}\hspace{0pt}%
\begin{tabular}{l l | l | l | l | l | l | l | l |}
\hline
2-4 & 2-8 & 3-4 & 3-5 & 4-7 & 4-8 & 5-6 & 5-9\\
\hline
1111 & 8 & 5 & 11 & 12 & 28 & 19 & 0\\
\hline
\end{tabular}\hspace{0pt}%
\label{tab:vo-ej2}
\end{table}
\end{document}
答案1
如果您希望有人阅读并理解您的表格,您可能需要重新设计它。您认为如何:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage[spanish]{babel}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{caption}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{table}
\centering
\caption{Valores óptimos Ejercicio 2}\label{tab:voed}
\begin{tabular}{c S[table-format=2.0]}
\toprule
$x_{ij}$ & {Valor} \\
\midrule
1-2 & 30 \\
1-3 & 15 \\
1-5 & 14 \\
$\vdots$ & {$\vdots$} \\
4-8 & 12 \\
\bottomrule
\end{tabular}\qquad
\begin{tabular}{c S[table-format=4.0]}
\toprule
$x_{ij}$ & {Valor} \\
\midrule
5-6 & \\
5-9 & \\
2-4 & 1111 \\
$\vdots$ & {$\vdots$} \\
5-9 & 0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}