1

I want to minimise the dominating effect of big cells in tables within a table by the following

  • have two major rows for each row where a dominating row such that the dominating cell will take place in the new major row. I call this option "footnote row" because you make a new full-width one-cell row for the dominating content.

Data are about MCQ questions which have own ids. They are not related so strict table structure is not mandatory. There is a table structure of 7 columns where one cell is dominating (biggest), causing much white space in the table (see Fig. 2). See Fig. 1 for a single row presentation, and repeat it for N rows and you get output like Fig. 2 where much white space.

Fig. 1 Output of one row where 1st column is set dominating (but without row ids which are in data sample now), Fig. 2 Low-resolution example output where too much white all over the place

enter image description here enter image description here

Two rows of data data.tex where dominating cells are at 2nd and 3rd column, respectively

1 & What is the difference between technical picture of acute donald duck between dragon in early adulthood comparing with elderly? & South Dragon & North Dragon & Manifold manifolds & Manifest colonisation & Upper limit    &5 \\ \hline
2 & South Dragon & What is the difference between technical picture of acute donald duck between dragon in early adulthood comparing with elderly? & North Dragon & Manifold manifolds & Manifest colonisation & Upper limit    &5 \\ \hline

Pseudocode

\documentclass{article}
\usepackage{tabularx}
\usepackage{ltablex} % Bernard
\begin{document}

\begin{ltablex}
\centering
\begin{tabularx}{\textwidth}{|l|p{.25\linewidth}|X|X|X|X|X|l|} % http://tex.stackexchange.com/a/340832/13173

1 & What is the difference between technical picture of acute donald duck between dragon in early adulthood comparing with elderly? & South Dragon & North Dragon & Manifold manifolds & Manifest colonisation & Upper limit    &5 \\ \hline
% TODO processhere the second dominating column cell into a new row taking full linewidth.  

\end{tabularx}
\end{ltablex}

\end{document}

TeXLive: 2016
OS: Debian 8.5

4
  • 2
    You can't insert a tabularx inside a longtable. The latter is not the multipage version of the table environment: , but the multipage version of table+tabular, and it has its own syntax for the caption. You can load the ltablex package, which brings the functionalities of longtable to tabularx.
    – Bernard
    Commented Dec 27, 2016 at 10:32
  • @Bernard I integrated your proposal to the body with a reference to you. I am testing more because I noticed that the biggest column of my data is fluctuating a lot so I need to find first the biggest column. Commented Dec 27, 2016 at 10:39
  • 1
    That's normal. Long table has to do some calculations. Oh, by the way, you should add the directive \keepXColumns to your preamble, if you want tabularx to have the prescribed width (otherwise it will be considered a maximum, depending on the real contents of the cells).
    – Bernard
    Commented Dec 27, 2016 at 10:46
  • @Bernard Can you please give an example about the latter as an answer? - - I did not get it. Commented Dec 27, 2016 at 10:55

1 Answer 1

1

I'm not sure in my understanding of your questions ... is the following table what you looking for?

enter image description here

\documentclass{article}
\usepackage{tabularx}
\usepackage{ltablex} % Bernard
\keepXColumns

\begin{document}
{\setlength\tabcolsep{3pt}
\begin{tabularx}{\textwidth}{|l|*{5}{X|}l|} %
    \hline
1   &   \multicolumn{6}{|p{\dimexpr\textwidth-2\tabcolsep\relax}|}{
        What is the difference between technical picture of acute donald duck between dragon in early adulthood comparing with elderly?}                \\ \hline
2   &   South Dragon & North Dragon & Manifold manifolds 
        &   Manifest colonisation & Upper limit    &    5   \\ \hline
\end{tabularx}
}
\end{document}

Addendum: see, if the following solution is what you looking for:

enter image description here

\documentclass{article}
\usepackage{tabularx}
\usepackage{ltablex} % Bernard
\keepXColumns
\usepackage{ragged2e}
\newcommand\subtab[2]{
    \multicolumn{6}{@{}>{\RaggedRight\arraybackslash}p{\textwidth}@{}}{%
    \begin{tabular*}{\hsize}%
    {|p{\dimexpr0.05\hsize-2\tabcolsep-3\arrayrulewidth\relax}|
      p{\dimexpr0.95\hsize-2\tabcolsep\relax}|}
      #1    &   #2    
     \end{tabular*}}
                      }

\begin{document}
{\setlength\tabcolsep{3pt}
\begin{tabularx}{\textwidth}{|*{5}{X|}l|} %
    \hline
\subtab{1}{What is the difference between technical picture of acute donald duck between dragon in early adulthood comparing with elderly?
                                     }                      \\ \hline
South Dragon & North Dragon & Manifold manifolds
        &   Manifest colonisation & Upper limit    &    5   \\ \hline
\end{tabularx}
}
\end{document}
5
  • It looks very nice. There is one thing which I would like to change. No row-number for the second row. The first number is the MCQ ID. Is that possible? Commented Dec 27, 2016 at 23:00
  • this is not so simple :(. see addendum to my answer, if I understand your question.
    – Zarko
    Commented Dec 27, 2016 at 23:46
  • Let's stick to the first version. - - Can you implement the output with only changes in preamble? - - Assume you have 777 rows of such data. One Question and its options at the same line. - - I am thinking how it is smart to make this for a general case. What do you think? Commented Dec 28, 2016 at 8:22
  • 1
    your last request is over my knowledge, i.e. it is impossible for me. maybe someone else know this, so i suggest you to ask this as new question, that will be more visible to audience.
    – Zarko
    Commented Dec 28, 2016 at 11:30
  • I expanded N case situation here tex.stackexchange.com/q/346033/13173 I accepted your answer because it is excellent starting point to think about N case situation. Commented Dec 28, 2016 at 13:28

You must log in to answer this question.

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