# want table to look like this

I use lyx with `elsarticle` class with two-column document but I made span columns so table will span over the two columns. I tried it with adding the `caption` package:

``````\usepackage[labelfont=bf,labelsep=newline,
justification=raggedright,singlelinecheck=false,
font=small]{caption}
``````

There I still have the following problems:
1- space or newline between caption and top of table
2- the word Table1 has larger size than caption text
3- the table is not full width of page as the other

Can I do the required without this `caption` package if available in lyx and how? If I must use the `caption` package how to fix the above problems? Also, how to add the code in lyx? (I put previous one in Latex Preamble)

This is what I want:

This is what I need to modify:

-
Welcome to TeX.SE! Please post a minimum working example of the code that's generating the problematic output. The image file you've posted so far is suggestive, but it also indicates that you're loading quite a few packages besides `caption` that may affect the result. – Mico Aug 30 '12 at 8:32
i use only caption package for elsarticle.lyx , is there anyway to get the required table with elsarticle.lyx? make bold Table1 with smaller font then in new line put caption text and then start table with full width of page without separating line before that table – mero Aug 30 '12 at 9:12
If you made the table with the LyX GUI, right click inside the tabular --> More --> Settings, and try to set the Table width to 100% of text width. – Torbjørn T. Aug 30 '12 at 11:47
Thanks the table is wider now, is there another way than caption package to make Table1 bold and new line before caption , may this solve the big font size of Table1 and big space after caption text? – mero Aug 30 '12 at 12:49

The width of the tabular can be set by right-clicking in it, selecting More --> Settings. For the Table-wide settings set the width to 100% of text width.

The distance between the caption text and table/figure can be set with the `skip=<distance>` option to `caption`, so you could add that option, e.g.

``````\usepackage[labelfont=bf,labelsep=newline,
justification=raggedright,singlelinecheck=false,
font=small ,skip=0pt]{caption}
``````

but that will affect the figures as well. Instead, do this:

``````\usepackage[labelfont=bf,labelsep=newline,
justification=raggedright,singlelinecheck=false,
font=small]{caption}
\captionsetup[table]{skip=0pt}
``````

This will change that skip for just the table captions.

I cannot say why the font size is different. Possibly some other package you're loading that interferes. If it is still a problem, I recommend asking a new question about just this issue.

-