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 addaleax committed Mar 11, 2020
1 parent d2e9177 commit 7baadb3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion doc/api_assets/style.css
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 7baadb3

Please sign in to comment.