0

I have a small problem with my thesis. It's the first time I work with latex and I have a problem with tables. I create the table below

\begin{table}[H]
%\centering
\caption{Mobile apps categories with some exemplary apps}
\label{table:1} %% \ref{table:1} pour la ref
\begin{tabular}{||c l l c l l||}
%%\hline
\hlineB{3.5}
\textbf{No.} & \textbf{Category} & \textbf{Examples of apps} & \textbf{No.} & \textbf{Category} & 
\textbf{Examples of apps} \\ [0.5ex]
\hline
\hline
1 & Calendar & Calendar & 13 & Weather & Weather \\  \hline
2 & Communication & Messenger, WhatsApp, TrueCaller & 14 & Games & Texas Poker, Quick ball, Ludo King 
\\ \hline
3 & Video Players and Editors & YouTube, HUAWEI Video & 15 & Music and Audio & Musique, Shazam, 
 spotify \\ \hline
4 & Clock & Clock, Horloge, Alarme & 16 & Entertainment & Netflix \\  \hline
5 & Sytem Tool & Setting, Calculatrice & 17 & Education & Google Translate  \\ \hline
6 & Health and fitness & Health, SmokeCount & 18 & Personnalisation & Theme, Wallpapers \\ \hline
7 & Phone and SMS  & Contacts, Dialler, Messages & 19 & Sports & beIN sport, Live Football Scores\\ 
\hline
 8 & Social Media & Facebook, Instagram, LinkedIn & 20 & News and Magazines & Google Podcast, Opera 
 News\\ \hline
 9 & Photography & Camera, Gallery & 21 & Shopping & IKEA\\ \hline
 10 & Lifestyle & Tinder, Jumia & 22 & Finance &  STB, CIC, Boursorama Banque\\ \hline
 11 & Maps and Navigation & Google Maps, Bolt & 23 & Productivity & PDF reader, Notepad, Docs\\ \ \ v 
\hline
 12 & Travel and Local & Kayak, Booking.com &    &    &   \\%%[1ex]
 \hlineB{3.5}
 \end{tabular}
 \end{table}

enter image description here Thank you so so much for you help.

Simon Dispa
  • 39,141
  • 1
    What exactly is the problem? That the table is wider than the page and is thus cut off? If so, you may want to a take a look at https://tex.stackexchange.com/q/332902/134144 – leandriis May 28 '21 at 17:23
  • Thank you for your answer, the problem is that the table is wider than the page, how can I do? – user243218 May 28 '21 at 17:31
  • 1
    The answer to My table doesn't fit; what are my options? contains a lot of useful approaches should be applicable to your table, as well. If you want a more specific advice regarding our table, please prepare a minimal working example (MWE) including the document class as well as the relevant packages. If you use the geometry package, also include the corresponding settings. – leandriis May 28 '21 at 18:20
  • Any news? You got two answers. Please inform us, if they solve your problem and please accept this one(by clicking on the check mark at top left side of selected answer) which solution on the best way fulfill your expectations. – Zarko Jun 05 '21 at 11:29
  • I have the same problem – user243218 Jun 06 '21 at 10:55

2 Answers2

2

Recently I discover the tabularray package ... For exercise let mi show two possible solution using this so versatile package for table settings. The first show table on landscape oriented page, the second one show redesigned table which can be easily fit on portrait page. The both use standard font size 10pt, however if is desired the second one can use also 11pt or 12pt and can be fit on page also when the package geometry is removed:

Since you not provide any information about your document design, I use \usepackage[vmargin=30mm]{geometry} for determining page layout.

\documentclass{article}
\usepackage[vmargin=30mm]{geometry}
\usepackage{pdflscape}  % landscape
\usepackage[skip=1ex,
            font=small, 
            labelfont=bf]{caption}
\usepackage[table]{xcolor}
\usepackage{tabularray}

\usepackage{lipsum}

\begin{document} \begin{landscape} \begin{table} \caption{Mobile apps categories with some exemplary apps} \label{table:1} %% \ref{table:1} pour la ref \begin{tblr}{colsep=3pt, colspec={c ll c ll}, row{odd}={gray!30} } \hline \textbf{No.}
& \textbf{Category}
& \textbf{Examples of apps}
& \textbf{No.} & \textbf{Category}
& \textbf{Examples of apps} \ \hline 1 & Calendar & Calendar
& 13 & Weather & Weather \ 2 & Communication & Messenger, WhatsApp, TrueCaller
& 14 & Games & Texas Poker, Quick ball, Ludo King \ 3 & Video Players and Editors & YouTube, HUAWEI Video
& 15 & Music and Audio & Musique, Shazam, spotify \ 4 & Clock & Clock, Horloge, Alarme
& 16 & Entertainment & Netflix \ 5 & Sytem Tool & Setting, Calculatrice
& 17 & Education & Google Translate \ 6 & Health and fitness & Health, SmokeCount
& 18 & Personnalisation & Theme, Wallpapers \ 7 & Phone and SMS & Contacts, Dialler, Messages
& 19 & Sports & beIN sport, Live Football Scores \ 8 & Social Media & Facebook, Instagram, LinkedIn
& 20 & News and Magazines & Google Podcast, Opera News\ 9 & Photography & Camera, Gallery
& 21 & Shopping & IKEA \ 10 & Lifestyle & Tinder, Jumia
& 22 & Finance & STB, CIC, Boursorama Banque \ 11 & Maps and Navigation & Google Maps, Bolt
& 23 & Productivity & PDF reader, Notepad, Docs \ 12 & Travel and Local & Kayak, Booking.com
& & & \ \hline \end{tblr} \end{table} \end{landscape}

\begin{table}

\caption{Mobile apps categories with some exemplary apps} \label{table:1} %% \ref{table:1} pour la ref \begin{tblr}{colspec={c X[l]X[l]}, row{odd}={gray!30} } \hline \textbf{No.} & \textbf{Category} & \textbf{Examples of apps} \ \hline 1 & Calendar & Calendar \ 2 & Communication & Messenger, WhatsApp, TrueCaller \ 3 & Video Players and Editors & YouTube, HUAWEI Video \ 4 & Clock & Clock, Horloge, Alarme \ 5 & Sytem Tool & Setting, Calculatrice \ 6 & Health and fitness & Health, SmokeCount \ 7 & Phone and SMS & Contacts, Dialler, Messages \ 8 & Social Media & Facebook, Instagram, LinkedIn \ 9 & Photography & Camera, Gallery \ 10 & Lifestyle & Tinder, Jumia \ 11 & Maps and Navigation & Google Maps, Bolt \ 12 & Travel and Local & Kayak, Booking.com \ 13 & Weather & Weather \ 14 & Games & Texas Poker, Quick ball, Ludo King\ 15 & Music and Audio & Musique, Shazam, spotify \ 16 & Entertainment & Netflix \ 17 & Education & Google Translate \ 18 & Personnalisation & Theme, Wallpapers \ 19 & Sports & beIN sport, Live Football Scores \ 20 & News and Magazines & Google Podcast, Opera News \ 21 & Shopping & IKEA \ 22 & Finance & STB, CIC, Boursorama Banque \ 23 & Productivity & PDF reader, Notepad, Docs \ \hline \end{tblr} \end{table}

\end{document}

On landscape page:

enter image description here

On portrait page, redesigned (only three columns and twice as many lines, it still can be fit on the one page):

enter image description here

Zarko
  • 296,517
  • Two remarks: (1) tblr environment doesn't use \tabcolsep, but you can use colsep=3pt in the preamble of the environment; (2) rowspec={*{7}{Q[gray!30]Q}} may be replaced with more meaningful row{odd}={gray!30}. – L.J.R. May 31 '21 at 01:42
  • @L.J.R., thank very much you for comment! I still learning this package (so I mentioned for exercise) and stil somewhere use approach known me from "classic" table environments. I will correct answer ASAP. – Zarko May 31 '21 at 01:45
1

By having the table in landscape mode it will fit in the page and it will be easy to read.

A

\documentclass[11pt,a4paper]{article}

\usepackage{pdflscape} % landscape

\usepackage{hhline} % double line

\usepackage{array} % strecth celld

\begin{document}

\begin{landscape}

\begin{table} \centering \small \caption{Mobile apps categories with some exemplary apps}\label{table:1} %% \ref{table:1} pour la ref \smallskip
\renewcommand{\arraystretch}{1.5} % exaonds the cells vertically \setlength{\tabcolsep}{4pt} \begin{tabular}{% ||c l l c l l||} \hline \textbf{No.} & \textbf{Category} & \textbf{Examples of apps} & \textbf{No.} & \textbf{Category} & \textbf{Examples of apps} \ [0.5ex] \hhline{======} 1 & Calendar & Calendar & 13 & Weather & Weather \ \hline 2 & Communication & Messenger, WhatsApp, TrueCaller & 14 & Games & Texas Poker, Quick ball, Ludo King \ \hline 3 & Video Players and Editors & YouTube, HUAWEI Video & 15 & Music and Audio & Musique, Shazam, spotify \ \hline 4 & Clock & Clock, Horloge, Alarme & 16 & Entertainment & Netflix \ \hline 5 & Sytem Tool & Setting, Calculatrice & 17 & Education & Google Translate \ \hline 6 & Health and fitness & Health, SmokeCount & 18 & Personnalisation & Theme, Wallpapers \ \hline 7 & Phone and SMS & Contacts, Dialler, Messages & 19 & Sports & beIN sport, Live Football Scores \ \hline 8 & Social Media & Facebook, Instagram, LinkedIn & 20 & News and Magazines & Google Podcast, Opera News \ \hline 9 & Photography & Camera, Gallery & 21 & Shopping & IKEA \ \hline 10& Lifestyle & Tinder, Jumia & 22 & Finance & STB, CIC, Boursorama Banque \ \hline 11& Maps and Navigation & Google Maps, Bolt & 23 & Productivity & PDF reader, Notepad, Docs \ \hline 12& Travel and Local & Kayak, Booking.com & & & \ \hline \end{tabular} \end{table} \end{landscape}

\end{document}

This second example uses the package nicematrix, replacing the horizontal lines with rows of alternate colors.

n

\documentclass[11pt,a4paper]{article}

\usepackage{pdflscape} % landscape

\usepackage{nicematrix}

\begin{document}

\begin{landscape}

\begin{table} \centering \small \caption{Mobile apps categories with some exemplary apps}\label{table:1} %% \ref{table:1} pour la ref \smallskip
\setlength{\tabcolsep}{4pt} \begin{NiceTabular}{% |c l l c l l|}[cell-space-limits = 6pt, code-before=\rowcolor{gray!50}{1} \rowcolors{2}{gray!25}{white}] % alternate row colors and expand cells \hline \textbf{No.} & \textbf{Category} & \textbf{Examples of apps} & \textbf{No.} & \textbf{Category} & \textbf{Examples of apps} \[0.5ex] 1 & Calendar & Calendar & 13 & Weather & Weather \ 2 & Communication & Messenger, WhatsApp, TrueCaller & 14 & Games & Texas Poker, Quick ball, Ludo King \ 3 & Video Players and Editors & YouTube, HUAWEI Video & 15 & Music and Audio & Musique, Shazam, spotify \ 4 & Clock & Clock, Horloge, Alarme & 16 & Entertainment & Netflix \ 5 & Sytem Tool & Setting, Calculatrice & 17 & Education & Google Translate \ 6 & Health and fitness & Health, SmokeCount & 18 & Personnalisation & Theme, Wallpapers \ 7 & Phone and SMS & Contacts, Dialler, Messages & 19 & Sports & beIN sport, Live Football Scores \ 8 & Social Media & Facebook, Instagram, LinkedIn & 20 & News and Magazines & Google Podcast, Opera News \ 9 & Photography & Camera, Gallery & 21 & Shopping & IKEA \ 10& Lifestyle & Tinder, Jumia & 22 & Finance & STB, CIC, Boursorama Banque \ 11& Maps and Navigation & Google Maps, Bolt & 23 & Productivity & PDF reader, Notepad, Docs \ 12& Travel and Local & Kayak, Booking.com & & & \ \hline \end{NiceTabular} \end{table} \end{landscape}

\end{document}

Simon Dispa
  • 39,141