Skip to content

Commit

Permalink
doc: prevent tables from shrinking page
Browse files Browse the repository at this point in the history
Tables on some pages (e.g. https://nodejs.org/api/crypto.html) are
quite wide because of long content (e.g. URLs) that don't break.
With this change, cell padding is smaller on small screens, and the
table content is allowed to break.

PR-URL: #31859
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
davidgilbertson authored and MylesBorins committed Mar 11, 2020
1 parent fa376f4 commit 38329bd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion doc/api_assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,30 @@ table {
th,
td {
border: 1px solid #aaa;
padding: .75rem 1rem;
padding: .5rem;
vertical-align: top;
}

th {
text-align: left;
}

td {
word-break: break-all; /* Fallback if break-word isn't supported */
word-break: break-word;
}

@media only screen and (min-width: 600px) {
th,
td {
padding: .75rem 1rem;
}

td:first-child {
word-break: normal;
}
}

ol,
ul,
dl {
Expand Down

0 comments on commit 38329bd

Please sign in to comment.