[Tex/LaTex] want table to look like this

boldelsarticlelyxtables

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: enter image description here

This is what I need to modify: enter image description here

Best Answer

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.