# Is there a way to display DataFrame with horizontal line for every row?

**URL:** https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719
**Category:** Data
**Tags:** dataframes, prettytables
**Created:** [September 10, 2023, 12:56pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719 "2023-09-10T12:56:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![huang\_min](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huang_min/32/34337_2.png) [@huang\_min](https://discourse.julialang.org/u/huang_min)
#### Post date: [September 10, 2023, 12:56pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/1 "2023-09-10T12:56:20Z")

</div>

I am doing some exploration on the screen for my dataframe with about 10 columns. Is there a way to print the table on the screen with horizontal line for every row just like a latex table? I could not find this option in the show() of DataFrame. Thanks.

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [September 10, 2023, 1:26pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/2 "2023-09-10T13:26:30Z")

</div>

If you use VSCode you can click on the data panel for the variable of interest and an Excel-like table will open letting you visualize all cols and all rows…

---

<div class="post-metadata">

### Author: ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)
#### Post date: [September 10, 2023, 3:21pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/3 "2023-09-10T15:21:13Z")

</div>

Consider also using [PrettyTables.jl](https://ronisbr.github.io/PrettyTables.jl/stable/)

---

<div class="post-metadata">

### Author: ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)
#### Post date: [September 10, 2023, 6:10pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/4 "2023-09-10T18:10:27Z")

</div>

Or in other words:

- `show` for data frame help lists only most common options (as there are too many to list)
- `show` supports all options of PrettyTables.jl

CC @Ronis_BR

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [September 10, 2023, 8:09pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/5 "2023-09-10T20:09:43Z")

</div>

Yes!

You can have all the lines you want:

```julia
julia> df = DataFrame(rand(10,10), :auto)
10×10 DataFrame
 Row │ x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
     │ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
   2 │ 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
   3 │ 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
   4 │ 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
   5 │ 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
   6 │ 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
   7 │ 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
   8 │ 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
   9 │ 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
  10 │ 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078

julia> show(df; hlines = :all, vlines = :all)
10×10 DataFrame
┌─────┬───────────┬───────────┬────────────┬──────────┬──────────┬───────────┬────────────┬──────────┬───────────┬───────────┐
│ Row │ x1 │ x2 │ x3 │ x4 │ x5 │ x6 │ x7 │ x8 │ x9 │ x10 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 1 │ 0.0716389 │ 0.784066 │ 0.374627 │ 0.493523 │ 0.675171 │ 0.938887 │ 0.701512 │ 0.541908 │ 0.937989 │ 0.697233 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 2 │ 0.624784 │ 0.513396 │ 0.606176 │ 0.515935 │ 0.432444 │ 0.671839 │ 0.683243 │ 0.649663 │ 0.869727 │ 0.730778 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 3 │ 0.840183 │ 0.642296 │ 0.022753 │ 0.14086 │ 0.827733 │ 0.0803897 │ 0.416368 │ 0.150438 │ 0.0195389 │ 0.22608 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 4 │ 0.971794 │ 0.197491 │ 0.448072 │ 0.186049 │ 0.609802 │ 0.286922 │ 0.260894 │ 0.765768 │ 0.499115 │ 0.308511 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 5 │ 0.0373043 │ 0.0894055 │ 0.186157 │ 0.093386 │ 0.844163 │ 0.955461 │ 0.0799212 │ 0.169375 │ 0.922238 │ 0.361566 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 6 │ 0.968046 │ 0.713258 │ 0.463439 │ 0.707651 │ 0.739382 │ 0.59466 │ 0.355122 │ 0.499858 │ 0.916289 │ 0.209395 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 7 │ 0.0928419 │ 0.82223 │ 0.826998 │ 0.938195 │ 0.300713 │ 0.170391 │ 0.69201 │ 0.384293 │ 0.108959 │ 0.460362 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 8 │ 0.391558 │ 0.590709 │ 0.772016 │ 0.111373 │ 0.529959 │ 0.785472 │ 0.00606464 │ 0.534936 │ 0.662282 │ 0.0748498 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 9 │ 0.741088 │ 0.0563262 │ 0.472633 │ 0.558224 │ 0.354916 │ 0.90828 │ 0.783904 │ 0.252325 │ 0.901037 │ 0.360539 │
├─────┼───────────┼───────────┼────────────┼──────────┼──────────┼───────────┼────────────┼──────────┼───────────┼───────────┤
│ 10 │ 0.686781 │ 0.587165 │ 0.00686523 │ 0.624827 │ 0.478205 │ 0.127479 │ 0.345735 │ 0.764431 │ 0.180345 │ 0.0421078 │
└─────┴───────────┴───────────┴────────────┴──────────┴──────────┴───────────┴────────────┴──────────┴───────────┴───────────┘

```

P.S.: @bkamins just one more reminder about how important that manual section on output customization is 😃 I am writing it, but I am having problems to find a balance between a huge and difficult to read section, and a more simple but without taking into account all the possibilities. Maybe the best thing is to start with the later and discuss in the PR…

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [September 10, 2023, 8:10pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/6 "2023-09-10T20:10:55Z")

</div>

Ah, and if you want only the horizontal lines, you can do:

```julia
julia> show(df; hlines = :all)
10×10 DataFrame
─────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Row │ x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   2 │ 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   3 │ 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   4 │ 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   5 │ 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   6 │ 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   7 │ 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   8 │ 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   9 │ 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
  10 │ 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078
─────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────

```

If you want to remove the vertical line in `Row` column, then do:

```julia
julia> show(df; hlines = :all, vlines = :none)
10×10 DataFrame
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Row x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   2 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   3 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   4 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   5 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   6 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   7 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   8 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   9 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  10 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────

```

---

<div class="post-metadata">

### Author: ![huang\_min](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huang_min/32/34337_2.png) [@huang\_min](https://discourse.julialang.org/u/huang_min)
#### Post date: [September 11, 2023, 12:59pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/7 "2023-09-11T12:59:50Z")

</div>

Thank you for the answer.

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [September 11, 2023, 8:25pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-display-dataframe-with-horizontal-line-for-every-row/103719/8 "2023-09-11T20:25:10Z")

</div>

Two packages which may be helpful

1. [TerminalPager.jl](https://ronisbr.github.io/TerminalPager.jl/dev/man/usage/) for a scroll-able view of a `DataFrame`
2. [FloatingTableView.jl](https://github.com/pdeffebach/FloatingTableView.jl) which opens up a new window for viewing the table.
