1

Here is the latex code:

\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline 
Sr. No & R (kpc) &  $v_rot$ (km/s) & $v_rot-\sigma$ & $v_rot+\sigma$ & $v_rot-st. error$ & $v_rot+st. error$ \\ 
\hline 
1 & 0.1000000
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 \\ 
\hline 
2 & 0.1200000
 & 190.70982
 & 180.44495
 & 200.97470
 & 178.51875
 & 202.90089
 \\ 
\hline 
3 & 0.1440000
 & 204.14069
 & 181.50659
 & 226.77478
 & 182.33299
 & 225.94838
 \\ 
\hline 
4 & 0.1728000
 & 207.60068
 & 203.02751
 & 212.17384
 & 203.40028
 & 211.80107
 \\ 
\hline 
5 & 0.2073600
 & 210.18828
 & 206.24573
 & 214.13083
 & 206.92996
 & 213.44659
 \\ 
\hline 
6 & 0.2488321
 & 213.51242
 & 209.29480
 & 217.73004
 & 210.32246
 & 216.70238
 \\ 
\hline 
7 & 0.2985985
 & 217.20825
 & 213.39551
 & 221.02100
 & 214.58551
 & 219.83099
 \\ 
\hline 
8 & 0.3583182
 & 219.67349
 & 217.49274
 & 221.85425
 & 218.30295
 & 221.04404
 \\ 
\hline 
9 & 0.4299819
 & 219.35750
 & 217.16428
 & 221.55072
 & 218.09828
 & 220.61671
 \\ 
\hline 
10 & 0.5159783
 & 216.16325
 & 212.42326
 & 219.90324
 & 214.20239
 & 218.12412
 \\ 
\hline 
11 & 0.6191739
 & 213.66953
 & 202.72714
 & 224.61191
 & 208.54335
 & 218.79570
 \\ 
\hline 
12 & 0.7430087
 & 219.49203
 & 196.89320
 & 242.09087
 & 210.87085
 & 228.11322
 \\ 
\hline 
13 & 0.8916104
 & 221.29033
 & 190.59332
 & 251.98734
 & 210.06566
 & 232.51500
 \\ 
\hline 
14 & 1.0699327
 & 235.33232
 & 179.62076
 & 291.04388
 & 213.18643
 & 257.47821
 \\ 
\hline 
15 & 1.2839192
 & 242.83345
 & 185.79965
 & 299.86725
 & 219.53412
 & 266.13278
 \\ 
\hline 
16 & 1.5407032
 & 248.29765
 & 195.89536
 & 300.69995
 & 228.28511
 & 268.31018
 \\ 
\hline 
17 & 1.8488438
 & 252.87955
 & 202.31192
 & 303.44717
 & 234.40387
 & 271.35522
 \\ 
\hline 
18 & 2.2186127
 & 245.01344
 & 209.83757
 & 280.18933
 & 232.94853
 & 257.07834
 \\ 
\hline 
19 & 2.6623352
 & 238.99704
 & 222.48454
 & 255.50954
 & 233.48685
 & 244.50723
 \\ 
\hline 
20 & 3.1948025
 & 236.55078
 & 227.31772
 & 245.78384
 & 233.53505
 & 239.56651
 \\ 
\hline 
21 & 3.8337631
 & 228.43219
 & 207.30084
 & 249.56354
 & 222.44080
 & 234.42358
 \\ 
\hline 
22 & 4.6005158
 & 222.71205
 & 192.34129
 & 253.08281
 & 215.21762
 & 230.20648
 \\ 
\hline 
23 & 5.5206194
 & 229.12407
 & 200.08731
 & 258.16083
 & 222.72687
 & 235.52127
 \\ 
\hline 
24 & 6.6247439
 & 243.19193
 & 219.59961
 & 266.78424
 & 237.93997
 & 248.44388
 \\ 
\hline 
25 & 7.9496927
 & 255.37874
 & 236.88005
 & 273.87744
 & 251.45024
 & 259.30725
 \\ 
\hline 
26 & 9.5396309
 & 261.36807
 & 246.69359
 & 276.04254
 & 258.54010
 & 264.19604
 \\ 
\hline 
27 & 11.447558
 & 263.48981
 & 252.04210
 & 274.93750
 & 261.36115
 & 265.61847
 \\ 
\hline 
28 & 13.737070
 & 262.79474
 & 252.75514
 & 272.83435
 & 261.02304
 & 264.56644
 \\ 
\hline 
29 & 16.484486
 & 257.34476
 & 245.18245
 & 269.50705
 & 255.36995
 & 259.31955
 \\ 
\hline 
30 & 19.781384
 & 246.14032
 & 232.69463
 & 259.58600
 & 244.15141
 & 248.12923
 \\ 
\hline 
31 & 23.737661
 & 236.51070
 & 224.78146
 & 248.23993
 & 234.93050
 & 238.09090
 \\ 
\hline 
32 & 28.485193
 & 232.33522
 & 215.75822
 & 248.91222
 & 230.22922
 & 234.44122
 \\ 
\hline 
33 & 34.182232
 & 233.52969
 & 206.17625
 & 260.88312
 & 229.70399
 & 237.35539
 \\ 
\hline 
34 & 41.018681
 & 230.44406
 & 178.01166
 & 282.87646
 & 220.62897
 & 240.25916
 \\ 
\hline 
35 & 49.222420
 & 237.06894
 & 127.68766
 & 346.45023
 & 213.14537
 & 260.99249
 \\ 
\hline 
36 & 59.066906
 & 249.44296
 & 114.89056
 & 383.99536
 & 222.99591
 & 275.89001
 \\ 
\hline 
37 & 70.880295
 & 218.48878
 & 86.133835
 & 350.84375
 & 193.83218
 & 243.14539
 \\ 
\hline 
38 & 85.056351
 & 206.60251
 & 71.599976
 & 341.60504
 & 179.34451
 & 233.86050
 \\ 
\hline 
39 & 102.06763
 & 213.00215
 & 80.545822
 & 345.45850
 & 183.68088
 & 242.32343
 \\ 
\hline 
40 & 122.48116
 & 197.38297
 & 91.656158
 & 303.10977
 & 174.02448
 & 220.74146
 \\ 
\hline 
41 & 146.97740
 & 177.52109
 & 95.759117
 & 259.28305
 & 160.85951
 & 194.18266
 \\ 
\hline 
42 & 176.37288
 & 165.32518
 & 90.673500
 & 239.97687
 & 149.61955
 & 181.03081
 \\ 
\hline 
43 & 211.64746
 & 165.13419
 & 88.205139
 & 242.06323
 & 146.40096
 & 183.86742
 \\ 
\hline 
44 & 253.97696
 & 160.78725
 & 83.387566
 & 238.18692
 & 138.06747
 & 183.50702
 \\ 
\hline 
45 & 304.77237
 & 151.10190
 & 76.308479
 & 225.89532
 & 123.22250
 & 178.98131
 \\ 
\hline 
46 & 365.72687
 & 121.97353
 & 25.493340
 & 218.45374
 & 78.542664
 & 165.40440
 \\ 
\hline 
47 & 438.87222
 & 168.30278
 & 42.566956
 & 294.03860
 & 116.82118
 & 219.78438
 \\ 
\hline 
48 & 526.64673
 & 200.54523
 & 77.195190
 & 323.89526
 & 147.59630
 & 253.49416
 \\ 
\hline 
49 & 631.97607
 & 238.97273
 & 91.137421
 & 386.80804
 & 202.77776
 & 275.16772
 \\ 
\hline 
50 & 758.37134
 & 248.06854
 & 103.06313
 & 393.07397
 & 228.35280
 & 267.78430
 \\ 
\hline 
51 & 910.04559
 & 250.37715
 & 109.02409
 & 391.73022
 & 227.71413
 & 273.04016
 \\ 
\hline 
52 & 1092.0548
 & 241.89972
 & 103.24272
 & 380.55670
 & 202.86862
 & 280.93082
 \\ 
\hline 
53 & 1310.4658
 & 235.03870
 & 131.55847
 & 338.51892
 & 188.53064
 & 281.54675
 \\ 
\hline 
54 & 1572.5590
 & 332.73450
 & 223.23077
 & 442.23822
 & 278.62488
 & 386.84412
 \\ 
\hline 
55 & 1887.0709
 & 414.94214
 & 345.36310
 & 484.52118
 & 387.01141
 & 442.87286
 \\ 
\hline 
\end{tabular} 
\end{table}

The table is cut off from the right, and it runs off the page. How do I fix this?

2
  • compilation is fine --though it covers the full page--slight error at serial 46 column 3--the 25.49 shows a 2 also at the same position as the 9
    – js bibra
    Jan 15, 2020 at 12:46
  • @jsbibra thanks, fixed it!
    – dharpatell
    Jan 15, 2020 at 12:58

1 Answer 1

1

Reduce the font size to \small and decrease the margins by loading geometry with sensible margins.

However, I suggest improving the layout by using rules from booktabs and remove the vertical lines. See example 2. In addition, I recommend to split the heading over two lines, or hand tune (equalise) the space between the columns.

I example 3 I have split the heading and used tabularx to calculate optimale width of the columns. Also, left and right margins are increased , and the table width is narrowed to have more equal space between columns. The table is very long, nearly impossible to squeeze between top and bottom margin. Consider splitting it over two pages.

\documentclass{article}
\usepackage[margin=2cm]{geometry}

\begin{document}

\begin{table}
\centering\small
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline 
Sr. No & R (kpc) &  $v_rot$ (km/s) & $v_rot-\sigma$ & $v_rot+\sigma$ & $v_rot-st. error$ & $v_rot+st. error$ \\ 
\hline 
1 & 0.1000000
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 \\ 
\hline 
2 & 0.1200000
 & 190.70982
 & 180.44495
 & 200.97470
 & 178.51875
 & 202.90089
 \\ 
\hline 
3 & 0.1440000
 & 204.14069
 & 181.50659
 & 226.77478
 & 182.33299
 & 225.94838
 \\ 
\hline 
4 & 0.1728000
 & 207.60068
 & 203.02751
 & 212.17384
 & 203.40028
 & 211.80107
 \\ 
\hline 
5 & 0.2073600
 & 210.18828
 & 206.24573
 & 214.13083
 & 206.92996
 & 213.44659
 \\ 
\hline 
6 & 0.2488321
 & 213.51242
 & 209.29480
 & 217.73004
 & 210.32246
 & 216.70238
 \\ 
\hline 
7 & 0.2985985
 & 217.20825
 & 213.39551
 & 221.02100
 & 214.58551
 & 219.83099
 \\ 
\hline 
8 & 0.3583182
 & 219.67349
 & 217.49274
 & 221.85425
 & 218.30295
 & 221.04404
 \\ 
\hline 
9 & 0.4299819
 & 219.35750
 & 217.16428
 & 221.55072
 & 218.09828
 & 220.61671
 \\ 
\hline 
10 & 0.5159783
 & 216.16325
 & 212.42326
 & 219.90324
 & 214.20239
 & 218.12412
 \\ 
\hline 
11 & 0.6191739
 & 213.66953
 & 202.72714
 & 224.61191
 & 208.54335
 & 218.79570
 \\ 
\hline 
12 & 0.7430087
 & 219.49203
 & 196.89320
 & 242.09087
 & 210.87085
 & 228.11322
 \\ 
\hline 
13 & 0.8916104
 & 221.29033
 & 190.59332
 & 251.98734
 & 210.06566
 & 232.51500
 \\ 
\hline 
14 & 1.0699327
 & 235.33232
 & 179.62076
 & 291.04388
 & 213.18643
 & 257.47821
 \\ 
\hline 
15 & 1.2839192
 & 242.83345
 & 185.79965
 & 299.86725
 & 219.53412
 & 266.13278
 \\ 
\hline 
16 & 1.5407032
 & 248.29765
 & 195.89536
 & 300.69995
 & 228.28511
 & 268.31018
 \\ 
\hline 
17 & 1.8488438
 & 252.87955
 & 202.31192
 & 303.44717
 & 234.40387
 & 271.35522
 \\ 
\hline 
18 & 2.2186127
 & 245.01344
 & 209.83757
 & 280.18933
 & 232.94853
 & 257.07834
 \\ 
\hline 
19 & 2.6623352
 & 238.99704
 & 222.48454
 & 255.50954
 & 233.48685
 & 244.50723
 \\ 
\hline 
20 & 3.1948025
 & 236.55078
 & 227.31772
 & 245.78384
 & 233.53505
 & 239.56651
 \\ 
\hline 
21 & 3.8337631
 & 228.43219
 & 207.30084
 & 249.56354
 & 222.44080
 & 234.42358
 \\ 
\hline 
22 & 4.6005158
 & 222.71205
 & 192.34129
 & 253.08281
 & 215.21762
 & 230.20648
 \\ 
\hline 
23 & 5.5206194
 & 229.12407
 & 200.08731
 & 258.16083
 & 222.72687
 & 235.52127
 \\ 
\hline 
24 & 6.6247439
 & 243.19193
 & 219.59961
 & 266.78424
 & 237.93997
 & 248.44388
 \\ 
\hline 
25 & 7.9496927
 & 255.37874
 & 236.88005
 & 273.87744
 & 251.45024
 & 259.30725
 \\ 
\hline 
26 & 9.5396309
 & 261.36807
 & 246.69359
 & 276.04254
 & 258.54010
 & 264.19604
 \\ 
\hline 
27 & 11.447558
 & 263.48981
 & 252.04210
 & 274.93750
 & 261.36115
 & 265.61847
 \\ 
\hline 
28 & 13.737070
 & 262.79474
 & 252.75514
 & 272.83435
 & 261.02304
 & 264.56644
 \\ 
\hline 
29 & 16.484486
 & 257.34476
 & 245.18245
 & 269.50705
 & 255.36995
 & 259.31955
 \\ 
\hline 
30 & 19.781384
 & 246.14032
 & 232.69463
 & 259.58600
 & 244.15141
 & 248.12923
 \\ 
\hline 
31 & 23.737661
 & 236.51070
 & 224.78146
 & 248.23993
 & 234.93050
 & 238.09090
 \\ 
\hline 
32 & 28.485193
 & 232.33522
 & 215.75822
 & 248.91222
 & 230.22922
 & 234.44122
 \\ 
\hline 
33 & 34.182232
 & 233.52969
 & 206.17625
 & 260.88312
 & 229.70399
 & 237.35539
 \\ 
\hline 
34 & 41.018681
 & 230.44406
 & 178.01166
 & 282.87646
 & 220.62897
 & 240.25916
 \\ 
\hline 
35 & 49.222420
 & 237.06894
 & 127.68766
 & 346.45023
 & 213.14537
 & 260.99249
 \\ 
\hline 
36 & 59.066906
 & 249.44296
 & 114.89056
 & 383.99536
 & 222.99591
 & 275.89001
 \\ 
\hline 
37 & 70.880295
 & 218.48878
 & 86.133835
 & 350.84375
 & 193.83218
 & 243.14539
 \\ 
\hline 
38 & 85.056351
 & 206.60251
 & 71.599976
 & 341.60504
 & 179.34451
 & 233.86050
 \\ 
\hline 
39 & 102.06763
 & 213.00215
 & 80.545822
 & 345.45850
 & 183.68088
 & 242.32343
 \\ 
\hline 
40 & 122.48116
 & 197.38297
 & 91.656158
 & 303.10977
 & 174.02448
 & 220.74146
 \\ 
\hline 
41 & 146.97740
 & 177.52109
 & 95.759117
 & 259.28305
 & 160.85951
 & 194.18266
 \\ 
\hline 
42 & 176.37288
 & 165.32518
 & 90.673500
 & 239.97687
 & 149.61955
 & 181.03081
 \\ 
\hline 
43 & 211.64746
 & 165.13419
 & 88.205139
 & 242.06323
 & 146.40096
 & 183.86742
 \\ 
\hline 
44 & 253.97696
 & 160.78725
 & 83.387566
 & 238.18692
 & 138.06747
 & 183.50702
 \\ 
\hline 
45 & 304.77237
 & 151.10190
 & 76.308479
 & 225.89532
 & 123.22250
 & 178.98131
 \\ 
\hline 
46 & 365.72687
 & 121.97353
 & 25.493340
 & 218.45374
 & 78.542664
 & 165.40440
 \\ 
\hline 
47 & 438.87222
 & 168.30278
 & 42.566956
 & 294.03860
 & 116.82118
 & 219.78438
 \\ 
\hline 
48 & 526.64673
 & 200.54523
 & 77.195190
 & 323.89526
 & 147.59630
 & 253.49416
 \\ 
\hline 
49 & 631.97607
 & 238.97273
 & 91.137421
 & 386.80804
 & 202.77776
 & 275.16772
 \\ 
\hline 
50 & 758.37134
 & 248.06854
 & 103.06313
 & 393.07397
 & 228.35280
 & 267.78430
 \\ 
\hline 
51 & 910.04559
 & 250.37715
 & 109.02409
 & 391.73022
 & 227.71413
 & 273.04016
 \\ 
\hline 
52 & 1092.0548
 & 241.89972
 & 103.24272
 & 380.55670
 & 202.86862
 & 280.93082
 \\ 
\hline 
53 & 1310.4658
 & 235.03870
 & 131.55847
 & 338.51892
 & 188.53064
 & 281.54675
 \\ 
\hline 
54 & 1572.5590
 & 332.73450
 & 223.23077
 & 442.23822
 & 278.62488
 & 386.84412
 \\ 
\hline 
55 & 1887.0709
 & 414.94214
 & 345.36310
 & 484.52118
 & 387.01141
 & 442.87286
 \\ 
\hline 
\end{tabular} 
\end{table}

\end{document}

Example 2 – booktabs

enter image description here

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[table]{xcolor}
\usepackage{booktabs, array}
\setlength{\tabcolsep}{0.5em}
%\setlength{\extrarowheight}{1pt}


\begin{document}

\begin{table}
\centering\small
\begin{tabular}{@{}rrrrrrr@{}}
\toprule
\textsc{sno} & R (kpc) &  $v_rot$ (km/s) & $v_rot-\sigma$ & $v_rot+\sigma$ & $v_rot-st. error$ & $v_rot+st. error$ \\ 
\midrule
\arrayrulecolor{lightgray}
1 & 0.1000000
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 \\ 
2 & 0.1200000
 & 190.70982
 & 180.44495
 & 200.97470
 & 178.51875
 & 202.90089
 \\ 
3 & 0.1440000
 & 204.14069
 & 181.50659
 & 226.77478
 & 182.33299
 & 225.94838
 \\ 
4 & 0.1728000
 & 207.60068
 & 203.02751
 & 212.17384
 & 203.40028
 & 211.80107
 \\ 
5 & 0.2073600
 & 210.18828
 & 206.24573
 & 214.13083
 & 206.92996
 & 213.44659
 \\
\midrule 
%\addlinespace[0.5ex]
6 & 0.2488321
 & 213.51242
 & 209.29480
 & 217.73004
 & 210.32246
 & 216.70238
 \\ 
7 & 0.2985985
 & 217.20825
 & 213.39551
 & 221.02100
 & 214.58551
 & 219.83099
 \\ 
8 & 0.3583182
 & 219.67349
 & 217.49274
 & 221.85425
 & 218.30295
 & 221.04404
 \\ 
9 & 0.4299819
 & 219.35750
 & 217.16428
 & 221.55072
 & 218.09828
 & 220.61671
 \\ 
10 & 0.5159783
 & 216.16325
 & 212.42326
 & 219.90324
 & 214.20239
 & 218.12412
 \\ 
\midrule 
%\addlinespace[0.5ex]
11 & 0.6191739
 & 213.66953
 & 202.72714
 & 224.61191
 & 208.54335
 & 218.79570
 \\ 
12 & 0.7430087
 & 219.49203
 & 196.89320
 & 242.09087
 & 210.87085
 & 228.11322
 \\ 
13 & 0.8916104
 & 221.29033
 & 190.59332
 & 251.98734
 & 210.06566
 & 232.51500
 \\ 
14 & 1.0699327
 & 235.33232
 & 179.62076
 & 291.04388
 & 213.18643
 & 257.47821
 \\ 
15 & 1.2839192
 & 242.83345
 & 185.79965
 & 299.86725
 & 219.53412
 & 266.13278
 \\ 
\midrule 
%\addlinespace[0.5ex]
16 & 1.5407032
 & 248.29765
 & 195.89536
 & 300.69995
 & 228.28511
 & 268.31018
 \\ 
17 & 1.8488438
 & 252.87955
 & 202.31192
 & 303.44717
 & 234.40387
 & 271.35522
 \\ 
18 & 2.2186127
 & 245.01344
 & 209.83757
 & 280.18933
 & 232.94853
 & 257.07834
 \\ 
19 & 2.6623352
 & 238.99704
 & 222.48454
 & 255.50954
 & 233.48685
 & 244.50723
 \\ 
20 & 3.1948025
 & 236.55078
 & 227.31772
 & 245.78384
 & 233.53505
 & 239.56651
 \\ 
\midrule 
%\addlinespace[0.5ex]
21 & 3.8337631
 & 228.43219
 & 207.30084
 & 249.56354
 & 222.44080
 & 234.42358
 \\ 
22 & 4.6005158
 & 222.71205
 & 192.34129
 & 253.08281
 & 215.21762
 & 230.20648
 \\ 
23 & 5.5206194
 & 229.12407
 & 200.08731
 & 258.16083
 & 222.72687
 & 235.52127
 \\ 
24 & 6.6247439
 & 243.19193
 & 219.59961
 & 266.78424
 & 237.93997
 & 248.44388
 \\ 
25 & 7.9496927
 & 255.37874
 & 236.88005
 & 273.87744
 & 251.45024
 & 259.30725
 \\ 
\midrule 
%\addlinespace[0.5ex]
26 & 9.5396309
 & 261.36807
 & 246.69359
 & 276.04254
 & 258.54010
 & 264.19604
 \\ 
27 & 11.447558
 & 263.48981
 & 252.04210
 & 274.93750
 & 261.36115
 & 265.61847
 \\ 
28 & 13.737070
 & 262.79474
 & 252.75514
 & 272.83435
 & 261.02304
 & 264.56644
 \\ 
29 & 16.484486
 & 257.34476
 & 245.18245
 & 269.50705
 & 255.36995
 & 259.31955
 \\ 
30 & 19.781384
 & 246.14032
 & 232.69463
 & 259.58600
 & 244.15141
 & 248.12923
 \\ 
\midrule 
%\addlinespace[0.5ex]
31 & 23.737661
 & 236.51070
 & 224.78146
 & 248.23993
 & 234.93050
 & 238.09090
 \\ 
32 & 28.485193
 & 232.33522
 & 215.75822
 & 248.91222
 & 230.22922
 & 234.44122
 \\ 
33 & 34.182232
 & 233.52969
 & 206.17625
 & 260.88312
 & 229.70399
 & 237.35539
 \\ 
34 & 41.018681
 & 230.44406
 & 178.01166
 & 282.87646
 & 220.62897
 & 240.25916
 \\ 
35 & 49.222420
 & 237.06894
 & 127.68766
 & 346.45023
 & 213.14537
 & 260.99249
 \\ 
\midrule 
%\addlinespace[0.5ex]
36 & 59.066906
 & 249.44296
 & 114.89056
 & 383.99536
 & 222.99591
 & 275.89001
 \\ 
37 & 70.880295
 & 218.48878
 & 86.133835
 & 350.84375
 & 193.83218
 & 243.14539
 \\ 
38 & 85.056351
 & 206.60251
 & 71.599976
 & 341.60504
 & 179.34451
 & 233.86050
 \\ 
39 & 102.06763
 & 213.00215
 & 80.545822
 & 345.45850
 & 183.68088
 & 242.32343
 \\ 
40 & 122.48116
 & 197.38297
 & 91.656158
 & 303.10977
 & 174.02448
 & 220.74146
 \\ 
\midrule 
%\addlinespace[0.5ex]
41 & 146.97740
 & 177.52109
 & 95.759117
 & 259.28305
 & 160.85951
 & 194.18266
 \\ 
42 & 176.37288
 & 165.32518
 & 90.673500
 & 239.97687
 & 149.61955
 & 181.03081
 \\ 
43 & 211.64746
 & 165.13419
 & 88.205139
 & 242.06323
 & 146.40096
 & 183.86742
 \\ 
44 & 253.97696
 & 160.78725
 & 83.387566
 & 238.18692
 & 138.06747
 & 183.50702
 \\ 
45 & 304.77237
 & 151.10190
 & 76.308479
 & 225.89532
 & 123.22250
 & 178.98131
 \\ 
\midrule 
%\addlinespace[0.5ex]
46 & 365.72687
 & 121.97353
 & 25.493340
 & 218.45374
 & 78.542664
 & 165.40440
 \\ 
47 & 438.87222
 & 168.30278
 & 42.566956
 & 294.03860
 & 116.82118
 & 219.78438
 \\ 
48 & 526.64673
 & 200.54523
 & 77.195190
 & 323.89526
 & 147.59630
 & 253.49416
 \\ 
49 & 631.97607
 & 238.97273
 & 91.137421
 & 386.80804
 & 202.77776
 & 275.16772
 \\ 
50 & 758.37134
 & 248.06854
 & 103.06313
 & 393.07397
 & 228.35280
 & 267.78430
 \\ 
\midrule 
%\addlinespace[0.5ex]
51 & 910.04559
 & 250.37715
 & 109.02409
 & 391.73022
 & 227.71413
 & 273.04016
 \\ 
52 & 1092.0548
 & 241.89972
 & 103.24272
 & 380.55670
 & 202.86862
 & 280.93082
 \\ 
53 & 1310.4658
 & 235.03870
 & 131.55847
 & 338.51892
 & 188.53064
 & 281.54675
 \\ 
54 & 1572.5590
 & 332.73450
 & 223.23077
 & 442.23822
 & 278.62488
 & 386.84412
 \\ 
55 & 1887.0709
 & 414.94214
 & 345.36310
 & 484.52118
 & 387.01141
 & 442.87286
 \\ \arrayrulecolor{black}
\bottomrule
\end{tabular} 
\end{table}

\end{document}

Example 3 – tabularx and split headings

enter image description here

\documentclass{article}
\usepackage[left=3.5cm, right=3.5cm, top=1.2cm, bottom=2.5cm]{geometry}
\usepackage[table]{xcolor}
\usepackage{booktabs, array, tabularx}
\setlength{\tabcolsep}{0.5em}
%\setlength{\extrarowheight}{1pt}

% Multi-line left-aligned text with manual line breaks.
% The base line of the whole is at the top row.
% % Borrowed from https://tex.stackexchange.com/a/347138/9632
\newcommand*{\tstack}[1]{%
  \begingroup
    \renewcommand*{\arraystretch}{0.85}%
    \begin{tabular}[b]{@{}>{\centering\arraybackslash}p{\hsize}@{}}#1\end{tabular}%
  \endgroup
}

\newcolumntype{R}{>{\raggedleft\arraybackslash}X}

\begin{document}

\begin{table}
\centering\small
\begin{tabularx}{0.9\linewidth}{@{}r*{6}{R}@{}}
\toprule
\textsc{sno} & R (kpc) &  \tstack{$v_rot$ \\$(km/s$)} & \tstack{$v_rot$\\ $-\sigma$ }& \tstack{$v_rot$\\ $+\sigma$} & \tstack{$v_rot$\\ $-st. error$} & \tstack{$v_rot$ \\ $+st. error$} \\ 
\midrule
\arrayrulecolor{lightgray}
1 & 0.1000000
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 & 183.93909
 \\ 
2 & 0.1200000
 & 190.70982
 & 180.44495
 & 200.97470
 & 178.51875
 & 202.90089
 \\ 
3 & 0.1440000
 & 204.14069
 & 181.50659
 & 226.77478
 & 182.33299
 & 225.94838
 \\ 
4 & 0.1728000
 & 207.60068
 & 203.02751
 & 212.17384
 & 203.40028
 & 211.80107
 \\ 
5 & 0.2073600
 & 210.18828
 & 206.24573
 & 214.13083
 & 206.92996
 & 213.44659
 \\
\midrule 
%\addlinespace[0.5ex]
6 & 0.2488321
 & 213.51242
 & 209.29480
 & 217.73004
 & 210.32246
 & 216.70238
 \\ 
7 & 0.2985985
 & 217.20825
 & 213.39551
 & 221.02100
 & 214.58551
 & 219.83099
 \\ 
8 & 0.3583182
 & 219.67349
 & 217.49274
 & 221.85425
 & 218.30295
 & 221.04404
 \\ 
9 & 0.4299819
 & 219.35750
 & 217.16428
 & 221.55072
 & 218.09828
 & 220.61671
 \\ 
10 & 0.5159783
 & 216.16325
 & 212.42326
 & 219.90324
 & 214.20239
 & 218.12412
 \\ 
\midrule 
%\addlinespace[0.5ex]
11 & 0.6191739
 & 213.66953
 & 202.72714
 & 224.61191
 & 208.54335
 & 218.79570
 \\ 
12 & 0.7430087
 & 219.49203
 & 196.89320
 & 242.09087
 & 210.87085
 & 228.11322
 \\ 
13 & 0.8916104
 & 221.29033
 & 190.59332
 & 251.98734
 & 210.06566
 & 232.51500
 \\ 
14 & 1.0699327
 & 235.33232
 & 179.62076
 & 291.04388
 & 213.18643
 & 257.47821
 \\ 
15 & 1.2839192
 & 242.83345
 & 185.79965
 & 299.86725
 & 219.53412
 & 266.13278
 \\ 
\midrule 
%\addlinespace[0.5ex]
16 & 1.5407032
 & 248.29765
 & 195.89536
 & 300.69995
 & 228.28511
 & 268.31018
 \\ 
17 & 1.8488438
 & 252.87955
 & 202.31192
 & 303.44717
 & 234.40387
 & 271.35522
 \\ 
18 & 2.2186127
 & 245.01344
 & 209.83757
 & 280.18933
 & 232.94853
 & 257.07834
 \\ 
19 & 2.6623352
 & 238.99704
 & 222.48454
 & 255.50954
 & 233.48685
 & 244.50723
 \\ 
20 & 3.1948025
 & 236.55078
 & 227.31772
 & 245.78384
 & 233.53505
 & 239.56651
 \\ 
\midrule 
%\addlinespace[0.5ex]
21 & 3.8337631
 & 228.43219
 & 207.30084
 & 249.56354
 & 222.44080
 & 234.42358
 \\ 
22 & 4.6005158
 & 222.71205
 & 192.34129
 & 253.08281
 & 215.21762
 & 230.20648
 \\ 
23 & 5.5206194
 & 229.12407
 & 200.08731
 & 258.16083
 & 222.72687
 & 235.52127
 \\ 
24 & 6.6247439
 & 243.19193
 & 219.59961
 & 266.78424
 & 237.93997
 & 248.44388
 \\ 
25 & 7.9496927
 & 255.37874
 & 236.88005
 & 273.87744
 & 251.45024
 & 259.30725
 \\ 
\midrule 
%\addlinespace[0.5ex]
26 & 9.5396309
 & 261.36807
 & 246.69359
 & 276.04254
 & 258.54010
 & 264.19604
 \\ 
27 & 11.447558
 & 263.48981
 & 252.04210
 & 274.93750
 & 261.36115
 & 265.61847
 \\ 
28 & 13.737070
 & 262.79474
 & 252.75514
 & 272.83435
 & 261.02304
 & 264.56644
 \\ 
29 & 16.484486
 & 257.34476
 & 245.18245
 & 269.50705
 & 255.36995
 & 259.31955
 \\ 
30 & 19.781384
 & 246.14032
 & 232.69463
 & 259.58600
 & 244.15141
 & 248.12923
 \\ 
\midrule 
%\addlinespace[0.5ex]
31 & 23.737661
 & 236.51070
 & 224.78146
 & 248.23993
 & 234.93050
 & 238.09090
 \\ 
32 & 28.485193
 & 232.33522
 & 215.75822
 & 248.91222
 & 230.22922
 & 234.44122
 \\ 
33 & 34.182232
 & 233.52969
 & 206.17625
 & 260.88312
 & 229.70399
 & 237.35539
 \\ 
34 & 41.018681
 & 230.44406
 & 178.01166
 & 282.87646
 & 220.62897
 & 240.25916
 \\ 
35 & 49.222420
 & 237.06894
 & 127.68766
 & 346.45023
 & 213.14537
 & 260.99249
 \\ 
\midrule 
%\addlinespace[0.5ex]
36 & 59.066906
 & 249.44296
 & 114.89056
 & 383.99536
 & 222.99591
 & 275.89001
 \\ 
37 & 70.880295
 & 218.48878
 & 86.133835
 & 350.84375
 & 193.83218
 & 243.14539
 \\ 
38 & 85.056351
 & 206.60251
 & 71.599976
 & 341.60504
 & 179.34451
 & 233.86050
 \\ 
39 & 102.06763
 & 213.00215
 & 80.545822
 & 345.45850
 & 183.68088
 & 242.32343
 \\ 
40 & 122.48116
 & 197.38297
 & 91.656158
 & 303.10977
 & 174.02448
 & 220.74146
 \\ 
\midrule 
%\addlinespace[0.5ex]
41 & 146.97740
 & 177.52109
 & 95.759117
 & 259.28305
 & 160.85951
 & 194.18266
 \\ 
42 & 176.37288
 & 165.32518
 & 90.673500
 & 239.97687
 & 149.61955
 & 181.03081
 \\ 
43 & 211.64746
 & 165.13419
 & 88.205139
 & 242.06323
 & 146.40096
 & 183.86742
 \\ 
44 & 253.97696
 & 160.78725
 & 83.387566
 & 238.18692
 & 138.06747
 & 183.50702
 \\ 
45 & 304.77237
 & 151.10190
 & 76.308479
 & 225.89532
 & 123.22250
 & 178.98131
 \\ 
\midrule 
%\addlinespace[0.5ex]
46 & 365.72687
 & 121.97353
 & 25.493340
 & 218.45374
 & 78.542664
 & 165.40440
 \\ 
47 & 438.87222
 & 168.30278
 & 42.566956
 & 294.03860
 & 116.82118
 & 219.78438
 \\ 
48 & 526.64673
 & 200.54523
 & 77.195190
 & 323.89526
 & 147.59630
 & 253.49416
 \\ 
49 & 631.97607
 & 238.97273
 & 91.137421
 & 386.80804
 & 202.77776
 & 275.16772
 \\ 
50 & 758.37134
 & 248.06854
 & 103.06313
 & 393.07397
 & 228.35280
 & 267.78430
 \\ 
\midrule 
%\addlinespace[0.5ex]
51 & 910.04559
 & 250.37715
 & 109.02409
 & 391.73022
 & 227.71413
 & 273.04016
 \\ 
52 & 1092.0548
 & 241.89972
 & 103.24272
 & 380.55670
 & 202.86862
 & 280.93082
 \\ 
53 & 1310.4658
 & 235.03870
 & 131.55847
 & 338.51892
 & 188.53064
 & 281.54675
 \\ 
54 & 1572.5590
 & 332.73450
 & 223.23077
 & 442.23822
 & 278.62488
 & 386.84412
 \\ 
55 & 1887.0709
 & 414.94214
 & 345.36310
 & 484.52118
 & 387.01141
 & 442.87286
 \\ \arrayrulecolor{black}
\bottomrule
\end{tabularx} 
\end{table}

\end{document}
7
  • Thank you! This solved the problem. Do you have any advice on how to make the table look like the booktabs version, like the more refined tables in scientific articles?
    – dharpatell
    Jan 15, 2020 at 12:57
  • @dharpatell Please see updated answer.I will look at some more fine tuning. F.ex. light gray midrules between each 5. row instead of space
    – Sveinung
    Jan 15, 2020 at 13:05
  • Thanks! This looks so much better.
    – dharpatell
    Jan 15, 2020 at 13:29
  • @dharpatell I am look at a solution for splitting the headings on two lines
    – Sveinung
    Jan 15, 2020 at 13:30
  • However, the \toprule and \bottomrule and intermediate lines are not compiling properly. Is there a way to fix that?
    – dharpatell
    Jan 15, 2020 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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