# Print dataframe in HTML

**URL:** https://discourse.julialang.org/t/print-dataframe-in-html/5319
**Category:** Data
**Tags:** data
**Created:** [August 10, 2017, 4:05pm UTC](https://discourse.julialang.org/t/print-dataframe-in-html/5319 "2017-08-10T16:05:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [August 10, 2017, 4:05pm UTC](https://discourse.julialang.org/t/print-dataframe-in-html/5319/1 "2017-08-10T16:05:03Z")

</div>

I have a type that has as one of its fields a AbstractDataFrame:

```julia
struct GeoDataFrame{DF<:AbstractDataFrame}
  data::DF
  coordnames::Vector{Symbol}
end

```

This is how I print the object in plain text:

```julia
# compact show
Base.show(io::IO, geodata::GeoDataFrame) = begin
  dims = join(size(geodata.data), "×")
  cnames = join(geodata.coordnames, ", ", " and ")
  print(io, "$dims GeoDataFrame ($cnames)")
end

# multi-line show
Base.show(io::IO, ::MIME"text/plain", geodata::GeoDataFrame) = begin
  println(io, geodata)
  show(io, geodata.data, true, :Row, false)
end

```

I couldn’t, however; get the “text/html” MIME working. What is the method in DataFrames.jl that I have to call to get the underlying dataframe printed in HTML on Jupyter notebooks?

---

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [August 10, 2017, 5:16pm UTC](https://discourse.julialang.org/t/print-dataframe-in-html/5319/2 "2017-08-10T17:16:51Z")

</div>

`Base.show(io::IO, ::MIME"text/html", geodata::GeoDataFrame) = Base.show(io, MIME"text/html"(), geodata.data)` ?

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [August 10, 2017, 5:24pm UTC](https://discourse.julialang.org/t/print-dataframe-in-html/5319/3 "2017-08-10T17:24:50Z")

</div>

Oh, I missed that parenthesis after the MIME type in the call, thanks! 🙂
