0

I am try to add table to my Latex documet.

But table width goes out of page.

This is my code

     %table
 \begin{table}[h]
    \centering
    \caption{Implementation Assumptions and Dependencies}
    \label{tab: c4T1}
    \begin{tabular}{|l|l|}
    \hline \textbf{Assumptions} & \textbf{Dependencies} \\
    \hline  
        Private and Public keys share according to \newline secure exiting protocols. 
        & Video Stream Scanning Quality \newline depends on Mobile camera quality.\\
    \hline
            All keys Store secure manner in devices.  
        & Encoded data decoding depends on picture quality and another environment condition. (light)\\
    \hline  
        Assume media broadcast channel free of noise.
        & Encode and Decoding time depend on CPU power and Memory of machine and Mobile. \\
    \hline
    \end{tabular}
 \end{table}

this is my out put.

enter image description here

I need some expert to correct the output format as below.

enter image description here

3

enter image description here

\noindent% <-- important
\setlength\tabcolsep{3pt} % default: 6pt
 \begin{table}[h]
    \centering
    \caption{Implementation Assumptions and Dependencies}
    \label{tab: c4T1}
    \begin{tabularx}{\textwidth}{|X|X|}
        \hline \textbf{Assumptions} & \textbf{Dependencies} \\
        \hline  
        Private and Public keys share according to  secure exiting protocols. 
        & Video Stream Scanning Quality  depends on Mobile camera quality.\\
        \hline
        All keys Store secure manner in devices.  
        & Encoded data decoding depends on picture quality and another environment condition. (light)\\
        \hline  
        Assume media broadcast channel free of noise.
        & Encode and Decoding time depend on CPU power and Memory of machine and Mobile. \\
        \hline
    \end{tabularx}
\end{table}
7
  • 1
    +1. Please remove the \noindent directive, though, at it is in fact not needed at all. You could also remove the OP's \centering directive as it isn't needed either. Please also augment the code fragment so that it becomes compilable "out of the box", without any guesswork as to which packages may need to be loaded. (Yes, I do know that it's necessary to load the tabularx package. However, random future readers of your answers may not.) Finally, do consider adding a sentence or two to explain in words to readers how your answer accomplishes the OP's typographic objective.
    – Mico
    Mar 29 '20 at 6:56
  • error given ,'! LaTeX Error: Environment tabularx undefined.' and i also need ceter colum headers
    – uma
    Mar 29 '20 at 7:13
  • 3
    @uma did you load \usepackage{ tabularx} -- i suggest you upload your code also rather than only snippets to have a succesful rendering/compilation -- secondly you need to read the comments given above by Mico
    – js bibra
    Mar 29 '20 at 7:17
  • 1
    \multicolumn{1}{c}{\textbf{Assumptions}} --will center
    – js bibra
    Mar 29 '20 at 7:29
  • 1
    if you want centering plus the vertical lines in the header rows use-- \centering\arraybackslash{\textbf{Assumptions}}
    – js bibra
    Mar 29 '20 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.