In my document I want to include nested tables as in the picture below.
i- The table need to occupy the page width
ii- The left most column "GRP1" & "GRP2" to be left aligned on the page
iii- The column for aggregate percentage on right to be right aligned but the value in that to be centered.
iv – In the center column – the description to be left aligned. The nested part details table in the same column to be left aligned. the number of parts are variable. It could vary from 0 to 50. However in the same line maximum of 15 only can come. Remaining then will move to next line.
Need help in how to do the same in LATEX.
** EDIT**
I accept my mistake in forgetting the guideline and raising question without mentioning what I tried.
Adding the code that I'm trying. Being beginner the code does not yet follow the best practice for tex coding.
\documentclass[a4paper,12pt]{report}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{xcolor,colortbl}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{tabu}
\usepackage[includeheadfoot,top=0.25in, bottom=0.25in, left=0.25in, right=0.25in]{geometry}
\def\companylogo{\rule{2cm}{2cm}}
\definecolor{pwcolor}{RGB}{219, 48, 122}
\setlength\headheight{40pt} %% just to make warning go away. Adjust the value after looking into the warning.
\newlength\FHoffset
\setlength\FHoffset{0cm}
\addtolength\headwidth{0\FHoffset}
\fancyheadoffset{\FHoffset}
\title{My first report}
\date{2014-10-02}
\begin{document}
Hello World!\\
\begin{longtable}{l|c|r}
\cellcolor{blue!25}{Group-A}
&{
\begin{tabular}{llllllllll}
\multirow{3}{*} {} &
\multicolumn{9}{l}{Description1} & \\
{} &Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & Q8 & Q9 \\
{} &1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9
\end{tabular}
}
&\cellcolor{blue!25}{25}
\\
\hline
\cellcolor{red!25}{Group-B}
&{
\begin{tabular}{llllllllll}
\multirow{3}{*} {} &
\multicolumn{9}{l}{Description2} & \\
{} &Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & Q8 & Q9 \\
{} &1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9
\end{tabular}
}
&\cellcolor{red!25}{75}
\end{longtable}
\lipsum
\end{document}
the output table produced by this code is not getting aligned as per the page width.
More than code I would like some reference to approach this problem.
For point 4 – above where I mentioned that center column will have sub-table with dynamic column count. Currently I'm thinking to generate .tex file programmatically and then pass the output tex file from that utility for further processing.
thanks
Best Answer