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.

Using LyX, how can I make a 6 column table with the second row having multiple lines of text? I am trying to create the following layout in LyX:

screenshot

I'm using LyX 2.0 for mac.

What are ways to accomplish this?

share|improve this question
    
Hi Jane, Welcome to TeX.SE! Most TeX users would probably call this a table. There have been many questions on this site about tables- this link will take you directly to questions that have been tagged with them, and should help get you started. –  cmhughes Nov 26 '11 at 4:38
    
I've edited the title to refer to tables for future users: 'chart' is misleading here. –  Joseph Wright Nov 26 '11 at 12:00
    
If my answer solved your problem, would you consider accepting it, by clicking the checkmark on the left? This marks the question as "solved", and awards some points to both yourself and me. –  Torbjørn T. Dec 9 '11 at 0:30
add comment

2 Answers

To fill in a little on the LyX side of things:

You can create a tabular by either choosing Insert --> Table ... or clicking the enter image description here button on the toolbar. In both cases, you choose the number of columns and rows for your table. Say you create a table with 6 columns and 2 rows, then you'll get something like this:

enter image description here

You'll want to remove most of the lines in the table, so start by selecting all the cells, and clicking the appropriate buttons on the toolbar at the bottom of the LyX window (that's where the toolbar appears on my installation, at least):

enter image description here

The button on the far right in the red oval removes all the lines. However, you'll still want the horizontal lines above and below the top row, so select just this, and add the lines:

enter image description here

Following cmhughes, you can set the column width. You can do this by right clicking in a cell, choosing More --> Settings, and writing a width in the appropriate text box.

enter image description here

I think you have to do this for each column, but I may be wrong, as I don't use LyX that much.

Another thing you want to do in the settings, is to go to the Borders tab, and select the "Formal" style. This will make LyX use booktabs, that cmhughes described in his answer.

enter image description here

You can add more rows to your table, by clicking the Add row button in the bottom left of the tabular toolbar, or using the keyboard shortcut. On Windows this is Alt + M, W I, i.e., hold down Alt and press M, then release both and type WI. (May be different on your Mac, but it will probably show up as a tooltip then hovering the mouse over the button.)

enter image description here

share|improve this answer
    
If I could vote this up more than once I would. Exceptional. It also illustrates to me why I use LaTeX though. This seems rather complex! –  qubyte Nov 26 '11 at 10:07
1  
+1 for an excellent LyX answer! –  Daniel Nov 26 '11 at 14:15
    
+1 there are quite a few unanswered lyx questions that could benefit from this kind of great answer –  cmhughes Nov 26 '11 at 17:08
    
Thanks all! @cmhughes: I've looked at that list a couple of times, and if I was able to answer some of the questions, I would have. –  Torbjørn T. Nov 26 '11 at 17:17
    
+1 for showing that LyX actually supports booktabs (quite hidden so...) –  e-birk Apr 20 '13 at 20:35
add comment

I'm not sure about the Lyx side of things, but here's some code that should get you started.

Note that I've used the column type p{width} to represent a 'paragraph' column that takes a width as an argument. The & are column separators, and we use \\ to start a new line.

screenshot 1

\documentclass{article}

\begin{document}

\begin{table}
\centering
\begin{tabular}{|p{1.5cm}|p{2cm}|p{1.5cm}|p{2cm}|p{1.5cm}|p{2cm}|}
 \hline
 \textbf{Topic 1}             & \textbf{Topic 2}    &   \textbf{Topic 3} &  \textbf{Topic 4} & \textbf{Topic 5} & \textbf{Topic 6}\\ \hline
          here is some text   & text                & 0923 0923 0923     & some more text goes here    & and some more text goes here    & and yet more here  \\ \hline
\end{tabular}
\end{table}

\end{document}

A lot of users on this site would recommend using the booktabs package to make your tables beautiful. This package provides the commands \toprule, \midrule, and \bottomrule, which are demonstrated below.

screenshot 2

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}
\centering
\begin{tabular}{p{1.5cm}p{2cm}p{1.5cm}p{2cm}p{1.5cm}p{2cm}}
 \toprule
 \textbf{Topic 1}             & \textbf{Topic 2}    &   \textbf{Topic 3} &  \textbf{Topic 4} & \textbf{Topic 5} & \textbf{Topic 6}\\ 
 \midrule
          here is some text   & text                & 0923 0923 0923     & some more text goes here    & and some more text goes here    & and yet more here  \\ 
 \bottomrule
\end{tabular}
\end{table}

\end{document}
share|improve this answer
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.