2

What is the problem with this table?

\newlength\origheight
\setlength\origheight{\textheight}

\begin{landscape}

\begin{table}
    \scalebox{0.5}{
    \begin{tabularx}{\origheight}{@{} >{\bfseries}l *{7}{L} @{}} 

        \toprule
        Protocol name & \textbf{QT} & \textbf{OQTT} & \textbf{STT} 
        & \textbf{BS} & \textbf{CT} & \textbf{QwT} & \textbf{CwT} \\ 
        \midrule

        Protocol feature
        & They use random multi-access way to identify tags. In case of collision, the tags will be asked to send data later with a random time relay.
        & They identify the total number of tags in the interrogation zone. The reader controls every step of the protocol, using commands or queries to split colliding tags into subsets, and further repeatedly split those subsets until identifies all the tags.
        & They are mixture of Aloha and Tree-based protocols. They use two methods. The first is using randomized divisions in Tree-based algorithms, and another is using tree strategies after a collision in Aloha algorithms.
        & It involves transmitting a serial number from the reader to all the tags. Only tags which have equal or lower ID value than the received serial number will respond on request.
        & It is an improvement of QT which uses Bit tracking technology in order to find which bits collided and also where they are.
        & It applies a dynamic bit window to QT. All the tags compare their ID value with the query received and transmit a certain bit amount managed by the reader.
        & It applies the dynamic bit window to CT and adopts two techniques: bit tracking and the bit window.
        \\ \addlinespace
        Disadvantages
        & The reader sends a query and tags, whose ID prefix match that query, respond their full ID.
        & Very complex protocol, uses three technologies. The preprocessing increases the energy consumption of the protocol, especially in dense tag environments.
        & On every collision, the full tag response, apart from the initial query bits, is wasted.
        & The reader restart the reading process after a tag is identified.
        & It wastes a high number of tag bits on every collision, which increases the energy consumed by the reader during the process.
        & When the calculated ws is high, the reader command needs a high number of bits to represent it. That leads to a wastage of the reader bits.
        & Increase the number of reader bits
        \\ \addlinespace
        RTF/TTF 
        & RTF & RTF & RTF & RTF & RTF & RTF & RTF 
        \\
        Efficiency
        & 34.6\% & 61.4\% & 58\% & & 35\% & 80\% & 61\% 
        \\
        System cost 
        & Very low & Very expensive & Expensive & Medium & Low & Medium & Medium
        \\
        Complexity 
        & Very simple & Very high & High & Medium & Simple & Medium & Medium 
        \\
        \bottomrule 
    \end{tabularx}
}
    \caption{A comparison of tree-based protocols}
    \label{tab:ComparationThree}
\end{table}
\end{landscape}

Look how looks now. I want to be more wide to fit on whole page enter image description here

Bernard
  • 271,350
John988
  • 83
  • Should the five columns all have the same widths? If not, what about their relative widths? – Mico May 05 '18 at 00:51
  • @Mico for me is ok the same width. I want just to look better – John988 May 05 '18 at 00:52
  • 3
    your edits have left the question not understandable. You ask about justification in table columns (which is the default) and don't have any words to describe your actual issue. Your table generates multiple errors unrelated to justification because it has 8 columns but you have declared 6. (Mico's answer addresses all that but you could still edit the question to make it understandable to future readers) – David Carlisle May 05 '18 at 09:19
  • 2
    I'm afraid your further-modified query is quite unanswerable. You're not telling us which document class you use, which fonts you use, which font size you use, which paper size you use, and how tall and wide the text block is. And why do you employ \scalebox? (That can't possibly go well...) Please provide these missing pieces of information. – Mico May 05 '18 at 11:19
  • I've voted to close this posting as "unclear what you're asking". You've modified it so much (without even adapting the title) that it's become virtually impossible for new readers to understand what you're trying to achieve -- let alone come up with a query. – Mico May 05 '18 at 11:24

1 Answers1

6

(This version of answer addresses the heavily modified form of the OP's query and code, which is based the original form of my answer.)

The code in your revised query contains the instruction

\begin{tabularx}{\textwidth}{@{} >{\bfseries}l *{5}{X} @{}}

Since your table now contains 7 data columns, not 5 as before, you need to change this instruction to

\begin{tabularx}{\textwidth}{@{} >{\bfseries}l *{7}{X} @{}}

The X column type performs full justification. Given that the 7 data columns are quite narrow, full justification is bound to create large and unsightly inter-word gaps. In my view, it's preferable to typeset the material ragged-right. This may be done by adding the instructions

\usepackage{ragged2e}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

to the preamble and later on writing

\begin{tabularx}{\textwidth}{@{} >{\bfseries}l *{7}{L} @{}}

However, if you don't like the resulting look, simply revert to

\begin{tabularx}{\textwidth}{@{} >{\bfseries}l *{7}{X} @{}}

A separate point: Following up on your comments, I made the change from a sidewaystable setup to a combined landscape/table setup. That way, the table is rotated in the pdf file itself, removing any need for readers to crane their necks.

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} 
\usepackage{pdflscape,booktabs,tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X} % raggedright rather than full justification
\begin{document}

%% save the original value of the \textheight parameter:
\newlength\origheight
\setlength\origheight{\textheight}

\begin{landscape}
\begin{table}
\begin{tabularx}{\origheight}{@{} >{\bfseries}l *{7}{L} @{}} 

\toprule
Protocol name & \textbf{QT} & \textbf{OQTT} & \textbf{STT} 
& \textbf{BS} & \textbf{CT} & \textbf{QwT} & \textbf{CwT} \\ 
\midrule

Protocol feature
& They use random multi-access way to identify tags. In case of collision, the tags will be asked to send data later with a random time relay.
& They identify the total number of tags in the interrogation zone. The reader controls every step of the protocol, using commands or queries to split colliding tags into subsets, and further repeatedly split those subsets until identifies all the tags.
& They are mixture of Aloha and Tree-based protocols. They use two methods. The first is using randomized divisions in Tree-based algorithms, and another is using tree strategies after a collision in Aloha algorithms.
& It involves transmitting a serial number from the reader to all the tags. Only tags which have equal or lower ID value than the received serial number will respond on request.
& It is an improvement of QT which uses Bit tracking technology in order to find which bits collided and also where they are.
& It applies a dynamic bit window to QT. All the tags compare their ID value with the query received and transmit a certain bit amount managed by the reader.
& It applies the dynamic bit window to CT and adopts two techniques: bit tracking and the bit window.
\\ \addlinespace
Disadvantages
& The reader sends a query and tags, whose ID prefix match that query, respond their full ID.
& Very complex protocol, uses three technologies. The preprocessing increases the energy consumption of the protocol, especially in dense tag environments.
& On every collision, the full tag response, apart from the initial query bits, is wasted.
& The reader restart the reading process after a tag is identified.
& It wastes a high number of tag bits on every collision, which increases the energy consumed by the reader during the process.
& When the calculated ws is high, the reader command needs a high number of bits to represent it. That leads to a wastage of the reader bits.
& Increase the number of reader bits
\\ \addlinespace
RTF/TTF 
& RTF & RTF & RTF & RTF & RTF & RTF & RTF 
\\
Efficiency
& 34.6\% & 61.4\% & 58\% & & 35\% & 80\% & 61\% 
\\
System cost 
& Very low & Very expensive & Expensive & Medium & Low & Medium & Medium
\\
Complexity 
& Very simple & Very high & High & Medium & Simple & Medium & Medium 
\\
\bottomrule 
\end{tabularx}
\caption{A comparison of tree-based protocols}
\label{tab:ComparationThree}
\end{table}
\end{landscape}
\end{document}
Mico
  • 506,678
  • I did it but it is not justified (left and right) like in the Microsoft Word? – John988 May 05 '18 at 01:31
  • If you really need full justification, remove the \RaggedRight directive from the definition of the L column type. Be prepared to get some very wide, and rather unsightly, inter-word gaps. As I wrote in the answer above, I think the material looks a lot better if it's not fully justified. – Mico May 05 '18 at 01:38
  • It is ok for me. In the previous tables (that I have in latex) I used \begin{landscape} and in .pdf, the table was rotated. How to do it with your table – John988 May 05 '18 at 01:44
  • @John988 - The table is rotated. – Mico May 05 '18 at 01:52
  • Yes but when open in pdf the table is rotated on page. When I use \begin{landscape} the whole page where is table rotated – John988 May 05 '18 at 02:11
  • I used your table for another (new) table. I had a problem. Please look at my code in the first question (I edited original question). What is a problem? – John988 May 05 '18 at 02:26
  • @John988 -- Please see the updated answer I post a couple of minutes ago. Note that I also switched from sidewaystable to a combined landscape/table setup. – Mico May 05 '18 at 07:20
  • The table can not stand on the page? – John988 May 05 '18 at 10:12
  • Can I resize this table? – John988 May 05 '18 at 10:27
  • @John988 - I'm afraid I'm not familiar with the expression "stand on a page". As of now, the table takes up an entire page. Also, please clarify what you intend by resizing the table: Are you trying to make it smaller, or larger? – Mico May 05 '18 at 10:46
  • By the way thank you very much. Where I set the width of every cell in table? I want to put more text in every line (row) – John988 May 05 '18 at 10:51
  • please look my picture in question (above) – John988 May 05 '18 at 11:06
  • 1
    Instead of modifying an existing query to the extent that no outsider has a fighting chance of figuring out what might be going on, please post a new query when you have a new question. I'm going to vote to close the current query, since it's quite unlikely that future readers will have a smidgen of chance of figuring out what's going on. – Mico May 05 '18 at 11:23