website icon indicating copy to clipboard operation
website copied to clipboard

Tables are too wide

Open meyerbaptiste opened this issue 6 years ago • 2 comments

For example: https://api-platform.com/docs/core/events/#the-event-system capture d ecran 2018-10-11 a 16 08 29

meyerbaptiste avatar Oct 11 '18 14:10 meyerbaptiste

I see two ways of fixing this :

  • overflow-x: auto on the container, if a big table exists, user can scroll the whole container. Easy fix, but a bit weird
  • Wrap the <table> with <div style="overflow-x: auto">, a lot better UX wise, but need to see how to add that with the remark html generator from markdown

Fabious avatar Jan 02 '19 12:01 Fabious

Tried to find a nice solution to this and here's the problems i encounter (Gatsby related) :

gatsby-transformer-remark is used to parse the markdowns files, i don't think there is way to tell it : "hey, if you find a table, just wrap it in a div". No options for that.

I can use String.replace on the output string of this process (in gatsby-node.js), something like :

  • <table> -> <div><table>
  • </table> -> </div></table>

I don't know if it's a good solution tho...

Fabious avatar Jan 03 '19 15:01 Fabious