\documentclass[11pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{array}
\usepackage{tabularx}
\usepackage{fancyhdr}
\usepackage{caption}
\usepackage{hyperref}
\definecolor{headerblue}{RGB}{30,70,130}
\definecolor{lightblue}{RGB}{230,240,255}
\definecolor{lightgray}{RGB}{245,245,250}
\definecolor{darktext}{RGB}{40,40,50}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\small Table Template Examples}
\fancyhead[R]{\small LaTeX Tables Reference}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\title{\textbf{Professional Table Examples}\\[0.3em]\large A Reference for LaTeX Table Formatting}
\author{Documentation Team}
\date{2025}
\begin{document}
\maketitle
\section{Basic Table with Booktabs}
The \texttt{booktabs} package provides professional-quality horizontal rules. Use \verb|\toprule|, \verb|\midrule|, and \verb|\bottomrule| instead of \verb|\hline|.
\begin{table}[h]
\centering
\caption{Quarterly Revenue by Region (in \$M)}
\label{tab:basic}
\begin{tabular}{@{}lrrrr@{}}
\toprule
\textbf{Region} & \textbf{Q1} & \textbf{Q2} & \textbf{Q3} & \textbf{Q4} \\
\midrule
North America & 142.3 & 156.8 & 163.2 & 189.4 \\
Europe & 98.7 & 104.2 & 112.5 & 128.1 \\
Asia-Pacific & 76.4 & 82.1 & 91.8 & 105.3 \\
Latin America & 34.2 & 37.6 & 41.3 & 48.7 \\
Middle East & 18.9 & 21.4 & 24.7 & 29.2 \\
\midrule
\textbf{Total} & \textbf{370.5} & \textbf{402.1} & \textbf{433.5} & \textbf{500.7} \\
\bottomrule
\end{tabular}
\end{table}
\section{Table with Multirow and Multicolumn}
The \texttt{multirow} package allows cells to span multiple rows, while \verb|\multicolumn| handles column spanning.
\begin{table}[h]
\centering
\caption{Software Development Team Allocation}
\label{tab:multirowcol}
\begin{tabular}{@{}llccc@{}}
\toprule
\textbf{Department} & \textbf{Team} & \textbf{Engineers} & \textbf{Designers} & \textbf{PMs} \\
\midrule
\multirow{3}{*}{Product} & Core Platform & 12 & 2 & 2 \\
& Mobile Apps & 8 & 3 & 1 \\
& API Services & 6 & 0 & 1 \\
\midrule
\multirow{2}{*}{Infrastructure} & Cloud Ops & 5 & 0 & 1 \\
& Security & 4 & 0 & 1 \\
\midrule
\multirow{2}{*}{Data} & Analytics & 7 & 1 & 1 \\
& ML Platform & 9 & 1 & 1 \\
\midrule
\multicolumn{2}{@{}l}{\textbf{Total}} & \textbf{51} & \textbf{7} & \textbf{8} \\
\bottomrule
\end{tabular}
\end{table}
\section{Colored Rows (Alternating)}
Use the \texttt{colortbl} package with \verb|\rowcolor| for alternating row colors.
\begin{table}[h]
\centering
\caption{Programming Language Popularity Index (2025)}
\label{tab:colored}
\begin{tabular}{@{}clrrr@{}}
\toprule
\textbf{Rank} & \textbf{Language} & \textbf{Index (\%)} & \textbf{Change} & \textbf{Since} \\
\midrule
\rowcolor{lightblue}
1 & Python & 28.11 & +3.48 & 2001 \\
2 & JavaScript & 16.38 & --0.72 & 1995 \\
\rowcolor{lightblue}
3 & Java & 12.21 & --1.15 & 1995 \\
4 & C/C++ & 10.87 & +0.34 & 1972 \\
\rowcolor{lightblue}
5 & TypeScript & 7.43 & +2.91 & 2012 \\
6 & Go & 4.76 & +1.22 & 2009 \\
\rowcolor{lightblue}
7 & Rust & 3.94 & +1.87 & 2010 \\
8 & C\# & 3.56 & --0.42 & 2000 \\
\rowcolor{lightblue}
9 & Kotlin & 2.89 & +0.65 & 2011 \\
10 & Swift & 2.34 & +0.18 & 2014 \\
\bottomrule
\end{tabular}
\end{table}
\section{Wide Table with TabularX}
The \texttt{tabularx} package provides an \texttt{X} column type that automatically adjusts width to fill the available space.
\begin{table}[h]
\centering
\caption{Project Milestones and Status}
\label{tab:tabularx}
\begin{tabularx}{\textwidth}{@{}lXcl@{}}
\toprule
\textbf{Milestone} & \textbf{Description} & \textbf{Due Date} & \textbf{Status} \\
\midrule
M1: Requirements & Gather and document functional and non-functional requirements from all stakeholders. Conduct user interviews and competitive analysis. & 2025-01-15 & \textcolor{green!60!black}{Complete} \\
\addlinespace
M2: Architecture & Design system architecture including service boundaries, data models, API contracts, and infrastructure topology. & 2025-02-28 & \textcolor{green!60!black}{Complete} \\
\addlinespace
M3: MVP & Implement minimum viable product with core user flows: authentication, dashboard, and basic reporting. & 2025-04-30 & \textcolor{orange!80!black}{In Progress} \\
\addlinespace
M4: Beta & Feature-complete beta release with integration testing, performance benchmarks, and security audit. & 2025-06-30 & \textcolor{gray}{Planned} \\
\addlinespace
M5: Launch & Production deployment, monitoring setup, documentation finalization, and go-to-market activities. & 2025-08-15 & \textcolor{gray}{Planned} \\
\bottomrule
\end{tabularx}
\end{table}
\section{Long Table (Spanning Multiple Pages)}
The \texttt{longtable} package handles tables that may break across pages, with repeated headers.
\begin{longtable}{@{}clp{5cm}r@{}}
\caption{HTTP Status Codes Reference}\label{tab:longtable} \\
\toprule
\textbf{Code} & \textbf{Status} & \textbf{Description} & \textbf{Category} \\
\midrule
\endfirsthead
\multicolumn{4}{@{}l}{\textit{Continued from previous page}} \\
\toprule
\textbf{Code} & \textbf{Status} & \textbf{Description} & \textbf{Category} \\
\midrule
\endhead
\midrule
\multicolumn{4}{r@{}}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
200 & OK & Request succeeded. The response body contains the requested resource. & Success \\
\addlinespace
201 & Created & Request succeeded and a new resource was created. Typically returned after POST requests. & Success \\
\addlinespace
204 & No Content & Request succeeded but the server has no content to return. Common for DELETE operations. & Success \\
\addlinespace
301 & Moved Permanently & The requested resource has been permanently moved to a new URI. Clients should update bookmarks. & Redirection \\
\addlinespace
302 & Found & The resource temporarily resides at a different URI. The client should continue using the original URI. & Redirection \\
\addlinespace
304 & Not Modified & The resource has not been modified since the last request. The client can use its cached version. & Redirection \\
\addlinespace
400 & Bad Request & The server cannot process the request due to malformed syntax or invalid parameters. & Client Error \\
\addlinespace
401 & Unauthorized & Authentication is required. The request lacks valid credentials for the target resource. & Client Error \\
\addlinespace
403 & Forbidden & The server understood the request but refuses to authorize it. Authentication will not help. & Client Error \\
\addlinespace
404 & Not Found & The server cannot find the requested resource. The URI may be invalid or the resource may not exist. & Client Error \\
\addlinespace
405 & Method Not Allowed & The HTTP method is not supported for this resource. Check the Allow header for permitted methods. & Client Error \\
\addlinespace
409 & Conflict & The request conflicts with the current state of the resource. Common in concurrent update scenarios. & Client Error \\
\addlinespace
422 & Unprocessable Entity & The request was well-formed but contains semantic errors. Often used for validation failures. & Client Error \\
\addlinespace
429 & Too Many Requests & The client has sent too many requests in a given time window. Implement backoff and retry. & Client Error \\
\addlinespace
500 & Internal Server Error & An unexpected condition prevented the server from fulfilling the request. & Server Error \\
\addlinespace
502 & Bad Gateway & The server acting as a gateway received an invalid response from an upstream server. & Server Error \\
\addlinespace
503 & Service Unavailable & The server is temporarily unable to handle the request due to maintenance or overload. & Server Error \\
\addlinespace
504 & Gateway Timeout & The upstream server did not respond within the allowed time frame. & Server Error \\
\end{longtable}
\section{Compact Numerical Table}
A tightly formatted table for presenting numerical data with alignment on decimal points.
\begin{table}[h]
\centering
\caption{Machine Learning Model Comparison}
\label{tab:numerical}
\begin{tabular}{@{}l*{5}{r}@{}}
\toprule
\textbf{Model} & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1 Score} & \textbf{AUC} \\
\midrule
Logistic Regression & 0.847 & 0.831 & 0.862 & 0.846 & 0.912 \\
Random Forest & 0.891 & 0.878 & 0.903 & 0.890 & 0.948 \\
Gradient Boosting & 0.903 & 0.894 & 0.911 & 0.902 & 0.957 \\
Neural Network (MLP) & 0.897 & 0.886 & 0.908 & 0.897 & 0.953 \\
SVM (RBF Kernel) & 0.882 & 0.870 & 0.893 & 0.881 & 0.941 \\
\textbf{Ensemble (Stacked)} & \textbf{0.912} & \textbf{0.901} & \textbf{0.922} & \textbf{0.911} & \textbf{0.964} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

PDF Preview
Create an account to compile and preview