Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to set up a table to use in my CV, where by I list my qualifications and the date achieved (two separate columns), and under it the list of grades achieved. I want two separate sets of qualifications

For now assume this is what the companies I'm applying to want, so don't worry about general CV content advice.

This is what I'm trying to use:

\begin{tabularx}{0.9\linewidth}{X|r|X|r}
\textbf{GCSEs} & 2000\textendash 2005 & \textbf{A-Levels}   & 2005\textendash 2007 \\
\multicolumn{2}{p{0.45\linewidth}}{10 GCSES A*-C; including A*/A* for Science Double Award, A* for  Mathematics and A for English Language}
\multicolumn{2}{p{0.45\linewidth}}{Physics A, Chemistry B, Communication Studies B, Mathematics B.} \\

\end{tabularx}

But this is what it is producing:

enter image description here

And what I want is the section GCSEs and 2000-2005 aligned with the text below it (taking up ~50% of the table), and like-wise for A-Levels and 2005-2007. In both cases I'd like the dates left aligned.

Now I know there are many ways to skin a table in LaTeX, and I don't care how this gets fixed, I'd just like it fixed! Does anyone know of a way to sort this out?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You are missing a & between the multicolumns, also the specified width is greater than the width of the table as you are neglecting the inter-column space. In this small example there is no text that is actually being stretched by X at all and you could use a normal tabular rather than TX, but perhaps that's just an artifact of the example.

\documentclass{article}

\usepackage{tabularx,calc}
\begin{document}

\begin{tabularx}{0.9\linewidth}{X|r|X|r}
\textbf{GCSEs} & 2000\textendash 2005 & \textbf{A-Levels}   & 2005\textendash 2007 \\
\multicolumn{2}{p{0.45\linewidth - 2\tabcolsep}|}{10 GCSES A*-C; including A*/A* for Science Double Award, A* for  Mathematics and A for English Language}&
\multicolumn{2}{p{0.45\linewidth  - 2\tabcolsep}}{Physics A, Chemistry B, Communication Studies B, Mathematics B.} \\

\end{tabularx}

\end{document}
share|improve this answer
    
I didn't address the "dates left aligned" bit as I didn't understand it, you have them in r columns but the columns are exactly the width of the date so left or right alignment is the same? –  David Carlisle Feb 1 '12 at 13:23
    
The ends of the dates don't line up with the ends of the ends of the multicolumn cells, which is what I'm after. –  Pureferret Feb 1 '12 at 13:32
    
you need the multicolumn widths to be half the table width - 2`\tabcolsep`, which you can write as an inline expression if you use `calc package or etex syntax –  David Carlisle Feb 1 '12 at 14:27
    
I looked around for the calc package, and tried playing with the \widthof but I couldn't get it to work. Could you help out by adding that into your answer? –  Pureferret Feb 1 '12 at 15:00
    
see edit, I added calc usage –  David Carlisle Feb 1 '12 at 15:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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