Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrules6872/008b1edc68bf86267d9151d443f81dbf to your computer and use it in GitHub Desktop.
Save hrules6872/008b1edc68bf86267d9151d443f81dbf to your computer and use it in GitHub Desktop.
Adds horizontal scrolling to tables in Obsidian Notes
/* Adds horizontal scrolling to tables in Obsidian Notes. Tested in Obsidian v0.15.9
See also: https://forum.obsidian.md/t/css-horizontal-scrolling-tables/26581/4
*/
/* in preview / read mode */
.markdown-preview-view table ,
.markdown-source-view table {
display: block; /* This is needed for scrollbar */
width: 100%;
max-width: -moz-max-content;
max-width: max-content;
margin: 0 auto; /* this centers the table */
overflow-x: auto; /* This is needed for scrollbar */
white-space: nowrap; /* Keeps each cell on one line */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment