1

I've seen various examples but I am unable to adjust the table to the page accordingly as I continue to get errors when trying the adjust width or textwidth methods:

\begin{table}[hb!]
\centering
\captiontargets for protein assay measurements}
\begin{tabular}{clcl}
Protein Feature & \multicolumn{1}{c}{Input Features}       & Target             &   \\ 
\cline{1-3}
Activity        & Sequence, Substrate, Enzyme Activity    &   \\
Expression      & Sequence, New Host                       & Protein Expression &   \\
Stability       & Sequence, Detergent     & Thermal Stability  &   \\
\cline{1-3}
\end{tabular}
\end{table}
2
  • welcome -- have a look at the answer below
    – js bibra
    Commented Dec 9, 2020 at 8:29
  • 1
    Welcome to TeX.SE! You should provide complete small document, which we can compile as it is, not just code fragment. What is in the fourth column? You also should consider to use rules defined in booktabs7 package instead of hline`s.
    – Zarko
    Commented Dec 9, 2020 at 8:35

3 Answers 3

1

Two versions uing booktabs for the horizontal lines and tabularx or tabular* to make sure the table fits into the available textwidth.

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

\begin{table}[hb!]
\centering
\caption{targets for protein assay measurements}
\begin{tabularx}{\textwidth}{l>{\raggedright\arraybackslash}Xl}
\toprule
Protein Feature & Input Features                        & Target            \\ 
\midrule
Activity        & Sequence, Substrate, Enzyme Activity                       \\ \addlinespace
Expression      & Sequence, New Host                    & Protein Expression \\ \addlinespace
Stability       & Sequence, Detergent                   & Thermal Stability  \\
\bottomrule
\end{tabularx}
\end{table}


\begin{table}[hb!]
\centering
\setlength{\tabcolsep}{0pt}
\caption{targets for protein assay measurements}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll}
\toprule
Protein Feature & Input Features                        & Target            \\ 
\midrule
Activity        & Sequence, Substrate, Enzyme Activity                       \\ 
Expression      & Sequence, New Host                    & Protein Expression \\ 
Stability       & Sequence, Detergent                   & Thermal Stability  \\
\bottomrule
\end{tabular*}
\end{table}


\end{document}
0

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tabularx}
\begin{document}
    \begin{table}[hb!]
        \centering
%       \captiontargets for protein assay measurements}
    \begin{tabularx}{\textwidth}{XXX}
        \multicolumn{1}{c}{Protein Feature} & \multicolumn{1}{c}{Input Features}       & \multicolumn{1}{c}{Target}   \\ 
        \cline{1-3}
        Activity        & Sequence, Substrate, Enzyme Activity    &   \\
        Expression      & Sequence, New Host                       & Protein Expression   \\
        Stability       & Sequence, Detergent     & Thermal Stability   \\
        \cline{1-3}
    \end{tabularx}
\end{table}
\end{document}
1
  • thanks for following up but I still get a margin problem.. :/
    – Biohacker
    Commented Dec 9, 2020 at 8:39
0

With booktabs table defined in the tabularray package (version 2021P):

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
    \begin{table}[hb!]
\caption{Targets for protein assay measurements}
\label{tab:tblr}
\begin{booktabs}{
    colspec = @{} l X[l] l @{},
    rowsep=3pt
                }
    \toprule
Protein Feature & Input Features                        
                    & Target        \\
    \midrule
Activity        & Sequence, Substrate, Enzyme Activity
                    &               \\ 
Expression      & Sequence, New Host                    
                    & Protein Expression \\
Stability       & Sequence, Detergent                   
                    & Thermal Stability  \\
    \bottomrule
\end{booktabs}
    \end{table}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .