Tabellenbreite läuft mit den angegebenen Daten über

Tabellenbreite läuft mit den angegebenen Daten über

So einen Tisch hätte ich gernTisch

Allerdings wächst der Tisch nach rechts und überschreitet die Breite. Ich habe Folgendes versucht:

\documentclass[graybox]{svmult}
\usepackage[backend=biber, style=numeric, sorting=none]{biblatex}
\usepackage{type1cm}
%\usepackage{makeidx}         % allows index generation
\usepackage{graphicx}        % standard LaTeX graphics tool
                             % when including figure files
\usepackage{multicol}        % used for the two-column index
\usepackage[bottom]{footmisc}% places footnotes at page bottom
\usepackage{newtxtext}       %
\usepackage[varvw]{newtxmath}       % selects Times Roman as basic font
%\makeindex             % used for the subject index
                       % please use the style svind.ist with
                       % your makeindex program
%\usepackage{amssymb}
\usepackage{csquotes}
\graphicspath{{./images/}}
%Important
\addbibresource{references.bib}
% Math packages
\usepackage{amsmath, mathtools}
\usepackage[title]{appendix}
\usepackage[center]{caption}
\usepackage{subcaption}
\usepackage{manyfoot}%
%\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}%
\usepackage{changes}
\usepackage{appendix}
\usepackage{filecontents}
%Table packages
%Packages for Rotatebox
\usepackage[graphicx]{realboxes}
\usepackage{adjustbox}
\usepackage{booktabs, makecell, multirow, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage[figuresright]{rotating}
%\setlength{\rotFPtop}{0pt plus 1fil}
%\renewcommand{\theadfont}{\bfseries}
%\renewcommand{\theadfont}{\footnotesize\bfseries}
%\renewcommand\theadgape{}
%\setcellgapes{3pt}  % <--- new
\usepackage{siunitx}
%%%%%%%%%%%%%%%%%%
\usepackage{amsmath,amsfonts}
\usepackage{array}

\begin{document}
\begin{table}[htbp]

\caption{Sensor Data in Smart Healthcare}
\fontsize{8pt}{9pt}\selectfont
\setlength\tabcolsep{2pt}
\begin{tabular}{
           |c|
          >{\raggedright\arraybackslash}m{2cm}|
          >{\raggedright\arraybackslash}m{3cm}|
          >{\raggedright\arraybackslash}m{3cm}|
          >{\raggedright\arraybackslash}m{3cm}|
          }
\hline

 
    \textbf{Sl.No} & \textbf{Name of the Sensor} & \textbf{Measuring/Capturing Factor} & \textbf{Application in Smart Healthcare} & \textbf{Help in Disease Detection} \\
    \midrule
    1 & Accelerometer & Linear Acceleration & Use to capture the linear movement of a patient while performing any activities & Cardiac, Arthritis, Obesity, PCOD \\
    2 & Gyroscope & Angular Velocity & Use to capture the angular movement of a patient while performing any activities; such as rotation of the smart phone to change position & Cardiac, Arthritis, Obesity, PCOD \\
    3 & Image Sensor & Image \& Video & Use to capture the activities of a patient, while we need image data & Eye Health, Skin Health \\
    4 & Temperature & Body Temperature & Use to capture body temperature & Covid-19, Flu, Dengue, Pneumonia \\
    5 & Blood Pressure & Blood Pressure (Systolic and Diastolic) & Use to measure blood pressure of a patient & Cardiac, Obesity, PCOD \\
    6 & Oxygen Level & Oxygen level & Use to measure oxygen level in blood of a patient & Cardiac, Obesity, PCOD \\
    7 & Heart Rate & Heart Rate & Use to measure heart rates of a patient & Cardiac, Obesity, PCOD \\
    \bottomrule
\end{tabular}
 \end{table}

Antwort1

Ich habe keine svmultDokumentklasse, also verwende ich „Artikel“. Hoffentlich gibt es im Seitendesign keine allzu großen Unterschiede und für die Tabellenpositionierung im Text gelten die gleichen Regeln.

Ich würde deine Tabelle etwas umschreiben: alle senkrechten Linien entfernen, von den waagerechten nur die erste, zweite und letzte verwenden:

Bildbeschreibung hier eingeben

MWE:

%\documentclass[graybox]{svmult}
    \documentclass{article}
\usepackage{type1cm}
\usepackage{newtxtext}          %
\usepackage[varvw]{newtxmath}    % selects Times Roman as basic font

\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{caption}

\begin{document}
    \begin{table}[htbp] 
\caption{Sensor Data in Smart Healthcare}
\footnotesize
\begin{tblr}{colspec = {@{} c X[l] X[1.32, l] X[2.2, l] X[1.5, l] @{}},
             rowsep = 3pt,
             row{1} = {c, m, font=\bfseries} 
            }
    \toprule
Sl.No   &   Name of the Sensor
            &   Measuring/Capturing Factor
                &   {Application in\\ Smart Healthcare}
                    &   {Help in\\ Disease Detection}
                        \\
    \midrule
1   &   Accelerometer 
        &   Linear Acceleration 
            &   Use to capture the linear movement of a patient while performing any activities
                &   Cardiac, Arthritis, Obesity, PCOD 
                    \\
2   &   Gyroscope 
        &   Angular Velocity 
            &   Use to capture the angular movement of a patient while performing any activities; such as rotation of the smart phone to change position 
                &   Cardiac, Arthritis, Obesity, PCOD 
                    \\
3   &   Image Sensor 
        &   Image \& Video 
            &   Use to capture the activities of a patient, while we need image data 
                &   Eye Health, Skin Health 
                    \\
4   &   Temperature 
        &   Body Temperature 
            &   Use to capture body temperature 
                &   Covid-19, Flu, Dengue, Pneumonia
                    \\
5   &   Blood Pressure 
        &   Blood Pressure (Systolic and Diastolic) 
            &   Use to measure blood pressure of a patient 
                &   Cardiac, Obesity, PCOD
                    \\
6   &   Oxygen Level 
        &   Oxygen level 
            &   Use to measure oxygen level in blood of a patient 
                &   Cardiac, Obesity, PCOD
                    \\
7   &   Heart Rate 
        &   Heart Rate 
            &   Use to measure heart rates of a patient 
                &   Cardiac, Obesity, PCOD
                    \\
    \bottomrule
\end{tblr}
    \end{table}
\end{document}

Bitte testen Sie die vorgeschlagene Lösung mit Ihrer Dokumentklasse und teilen Sie mir mit, inwieweit das erhaltene Ergebnis von meinem oben gezeigten abweicht.

Antwort2

Ich würde wahrscheinlich so etwas machen:

\documentclass[graybox]{svmult}

\usepackage{newtxtext}%
\usepackage[varvw]{newtxmath}% selects Times Roman as basic font

\usepackage{array, tabularx, booktabs}
% booktabs is only because I am too lazy to define \heavyrulewidth.

\usepackage[center]{caption}

\newlength\scratchlength

\begin{document}

%--------------------------------------------------------------------------------------------------
\noindent Some text\hfill some text\hfill some text

\noindent A thick rule showing textwidth:

\medskip

\hrule height 1cm
%--------------------------------------------------------------------------------------------------

\begin{table}[htbp]%
\caption{Sensor Data in Smart Healthcare}%
%..................................
\fontsize{8pt}{9pt}\selectfont
\setlength\tabcolsep{2pt}%
\settowidth\scratchlength{Sl.No}%
\def\arraystretch{1.25}%
%..................................
\begin{tabularx}{\textwidth}{%
   !{\vrule width \heavyrulewidth}%
   >{\centering\arraybackslash}p{\scratchlength}%
   |%
   >{\raggedright\arraybackslash}X%
   |%
   >{\raggedright\arraybackslash}X%
   |%
   >{\raggedright\arraybackslash}X%
   |%
   >{\raggedright\arraybackslash}X%
   !{\vrule width \heavyrulewidth}%
}%
  %------------------------------------------------------------------------------------------------
  \noalign{\hrule height \heavyrulewidth}% <- This yields a \hline which is slightly thicker.
  %------------------------------------------------------------------------------------------------
  \raggedright\textbf{Sl.No}&%
  \textbf{Name of the Sensor}&%
  \textbf{Measuring/\hskip0pt Capturing Factor}&%
  \textbf{Application in Smart Healthcare}&%
  \textbf{Help in Disease Detection}\\%
  %------------------------------------------------------------------------------------------------
  %\noalign{\hrule height \lightrulewidth}%
  \noalign{\hrule height \heavyrulewidth}% <- This yields a \hline which is slightly thicker.
  %------------------------------------------------------------------------------------------------
  1&%
  Accelerometer&%
  Linear Acceleration&%
  Use to capture the linear movement of a patient while performing any activities&%
  Cardiac, Arthritis, Obesity, PCOD\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  2&%
  Gyroscope&%
  Angular Velocity&%
  Use to capture the angular movement of a patient while performing any activities;
    such as rotation of the smart phone to change position&%
  Cardiac, Arthritis, Obesity, PCOD\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  3&%
  Image Sensor&%
  Image \& Video&%
  Use to capture the activities of a patient, while we need image data&%
  Eye Health, Skin Health\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  4&%
  Temperature&%
  Body Temperature&%
  Use to capture body temperature&%
  Covid-19, Flu, Dengue, Pneumonia\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  5&%
  Blood Pressure&%
  Blood Pressure (Systolic and Diastolic)&%
  Use to measure blood pressure of a patient&%
  Cardiac, Obesity, PCOD\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  6&%
  Oxygen Level&%
  Oxygen level&%
  Use to measure oxygen level in blood of a patient&%
  Cardiac, Obesity, PCOD\\%
  %------------------------------------------------------------------------------------------------
  \hline
  %------------------------------------------------------------------------------------------------
  7&%
  Heart Rate&%
  Heart Rate&%
  Use to measure heart rates of a patient&%
  Cardiac, Obesity, PCOD\\%
  %------------------------------------------------------------------------------------------------
  \noalign{\hrule height \heavyrulewidth}% <- This yields a \hline which is slightly thicker.
  %------------------------------------------------------------------------------------------------
\end{tabularx}%
\end{table}%

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen