Graphics, Figures & TablesProblem with table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
yago
Posts: 29
Joined: Sat Dec 13, 2008 6:40 pm

Problem with table

Post by yago »

Hello to all. I don't have help with my similar post in "Graphics, Figures & Tables" about this topic... After many experiments I have now this code. But I don't know how can I vertically center the text in the columns 1, 2, 5 and 6 like the attached jpg. Thanks for your help.

Code: Select all

\documentclass[spanish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{array}
\makeatletter
\providecommand{\tabularnewline}{\\}
\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\usepackage{multirow}
\makeatother
\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}
\begin{document}
\begin{tabular}{|>{\raggedright}m{1.5cm}|>{\raggedright}m{1.6cm}|>{\raggedright}m{3.1cm}|>{\raggedright}m{5.1cm}|>{\raggedright}m{2.4cm}|>{\centering}m{2cm}|}
\hline
% cabecera
\centering\footnotesize{$\mathbf{C_{0}}$}\\\textbf{Ocean\\Region\\code\\(when\\required)} &
\centering\footnotesize{$\mathbf{C_{1}}$}\\\textbf{Priority}\\
\textbf{code} &
\centering\footnotesize{$\mathbf{C_{2}}$}\\\textbf{Service code} &
\centering\footnotesize{$\mathbf{C_{3}}$}\\\textbf{Address code} &
\centering\footnotesize{$\mathbf{C_{4}}$}\\\textbf{Repetition code}\\{(See Annex 5,\\Part E)} &
\centering\footnotesize{$\mathbf{C_{5}}$}\\\textbf{Presentation\\code}\tabularnewline
\hline 
% primera fila
\centering\footnotesize{1 digit\\code} & 
\centering\footnotesize{1 digit code} & 
\centering\footnotesize{2 digit code} & 
\centering\footnotesize{2, 4, 10 or 12 alphanumeric code} & 
\centering\footnotesize{2 digit code} & 
\centering\footnotesize{Normally a 2\\digit code}\tabularnewline
\hline
% segunda fila
\footnotesize{\multirow{8}{1.5cm}{0 - AOR-W\\1 - AOR-E\\2 - POR\\3 - IOR\\9 - All\\Ocean\\Regions$^{1}$}} & 
\footnotesize{\multirow{8}{1.6cm}{1 - Safety\\2 - Urgency\\3 - Distress\\}} & 
\footnotesize{00 - All ships (general\\call)} & 
\footnotesize{2 digit - 00 (All ships)} & 
\footnotesize{\multirow{8}{2.4cm}{\textbf{Category (a)\,-}\\for EGC messages\\to be repeated\\a finite number of\\times\\\vspace*{10pt}
\textbf{Category (b)\,-}\\for EGC messages\\to be repeated at\\specified\\intervals until\\cancelled by the\\MSI provider}} & 
\footnotesize{\multirow{8}{2cm}{\centering{00}}}\tabularnewline
\cline{3-4}
% tercera fila
& & \footnotesize{04 - Navigational,\\Meteorological or\\Piracy warnings to a\\rectangular area} & \footnotesize{12 digit rectangular area address\\$\mathrm{D_{1}D_{2}N(S)D_{3}D_{4}D_{5}E(W)D_{6}D_{7}D_{8}D_{9}D_{10}}$} & & \tabularnewline
\cline{3-4}

& & \footnotesize{13 - Navigational,\\Meteorological or\\Piracy Coastal warning} & \footnotesize{4 digit coastal warning area address\\$\mathrm{X_{1}X_{2}B_{1}B_{2}}$} & & \tabularnewline
\cline{3-4}

& & \footnotesize{14 - Shore-to-Ship\\Distress Alert to a\\circular area} & \footnotesize{10 digit circular area address\\$\mathrm{D_{1}D_{2}N(S)D_{3}D_{4}E(W)M_{1}M_{2}M_{3}}$} & & \tabularnewline
\cline{3-4}

& & \footnotesize{24 - Navigational,\\Meteorological or\\Piracy warning to a\\circular area} & \footnotesize{10 digit circular area address\\$\mathrm{D_{1}D_{2}N(S)D_{3}D_{4}E(W)M_{1}M_{2}M_{3}}$} & & \tabularnewline
\cline{3-4}

& & \footnotesize{31 - NAVAREA/\\METAREA warning, MET Forecast, or\\Piracy warning to\\NAVAREA} & \footnotesize{2 digit - NAVAREA/METAREA} & & \tabularnewline
\cline{3-4}

& & \footnotesize{34 - SAR Coordination\\to a rectangular area} & \footnotesize{12 digit rectangular area address\\$\mathrm{D_{1}D_{2}N(S)D_{3}D_{4}D_{5}E(W)D_{6}D_{7}D_{8}D_{9}D_{10}}$} & & \tabularnewline
\cline{3-4}

& & \footnotesize{44 - SAR Coordination\\to a circular area} & \footnotesize{10 digit circular area address\\$\mathrm{D_{1}D_{2}N(S)D_{3}D_{4}E(W)M_{1}M_{2}M_{3}}$} & & \tabularnewline
\hline

\multicolumn{6}{|l|}{{\footnotesize 1) Subject to availability trough LES or service provider}}\tabularnewline
\hline
\end{tabular}
\end{document}
Attachments
Table_C_codes.jpg
Table_C_codes.jpg (103.68 KiB) Viewed 1662 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with table

Post by localghost »

yago wrote:Hello to all. I don't have help with my similar post in "Graphics, Figures & Tables" about this topic […]
That's no reason to post a topic clearly related to tables somewhere else. And for code in any shape please use the code environment. Your code is a little bit confusing. It will take some time to set up the table for the desired output.


Best regards
Thorsten
Post Reply