6

I'm making an ordinary table in LyX and the table is going off-page. Seems that LyX isn't wrapping text inside the cells, and having done a search here on SE I still cannot find a solution which would simply

  • Restrict the overall table width to page width; and
  • Wrap text inside table cells

I've tried some of the advice offered in other answers to this question, but it seems to scale the entire table which is definitely not what I want. I just want text wrapping inside the cells. Thanks.

9
  • You need to specify a width for the columns. Related: tex.stackexchange.com/questions/330508/… Oct 5, 2016 at 10:50
  • @TorbjørnT. I don't know the width of the individual columns. I only know the page width, I want the rest handled for me. Oct 5, 2016 at 11:08
  • You can specify widths in fractions of the width of the text block, but unless you want to write the table code by hand (using tabularx and X columns), I don't think there's a way of avoiding specifying widths one way or another. Oct 5, 2016 at 11:12
  • @TorbjørnT. any way of using tabularx in lyx? Oct 5, 2016 at 13:34
  • Beyond writing the code manually in an ERT, or a separate text file that you insert e.g. as a child document, I don't think so. Try searching in the Wiki or bug tracker on LyX.org though (the site is down at the moment it seems, so I can't do it myself), I don't use LyX, and I'm not aware of everything about it. Oct 5, 2016 at 13:46

1 Answer 1

9

I found a non-code solution based on trial and error. First, place the cursor on the desired column, go to Table Settings > Column settings, then set the value of Width in respect of Page Width.

Here is my screenshot editing first column:

And this is the result: result

1
  • 1
    One tip I have is to start by setting the value to 10% of the page width, cliking "Apply" (don't close the dialog box yet). Now click the "View" button on the main GUI to see the generated pdf. See if the table is of the right width. Go back to the dialog box and change the percentage to 18% or 20% etc. as required. Rinse. Repeat.
    – Nav
    Apr 3, 2020 at 5:36

You must log in to answer this question.

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