Skip to content

Commit

Permalink
render width fix
Browse files Browse the repository at this point in the history
For an unknown reason, rendering of some books was resulting in the table expanding beyond 100% browser width. These CSS changes fix the issue.
  • Loading branch information
wydengyre committed Oct 12, 2024
1 parent f1a0fb0 commit e80a335
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/cf/test/aligned.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions packages/cli/test/bovary.aligned.cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
line-height: 33px;
}

table {
width: 100%;
table-layout: fixed;
}

thead {
position: sticky;
top: 0;
Expand All @@ -27,9 +32,11 @@
}

td {
box-sizing: border-box;
vertical-align: top;
width: 50%;
padding: 0 1em 1em;
word-wrap: break-word;
}

#swap-columns {
Expand Down
7 changes: 7 additions & 0 deletions packages/core/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ const TEMPLATE = `<!DOCTYPE html>
line-height: 33px;
}
table {
width: 100%;
table-layout: fixed;
}
thead {
position: sticky;
top: 0;
Expand All @@ -74,9 +79,11 @@ const TEMPLATE = `<!DOCTYPE html>
}
td {
box-sizing: border-box;
vertical-align: top;
width: 50%;
padding: 0 1em 1em;
word-wrap: break-word;
}
#swap-columns {
Expand Down

0 comments on commit e80a335

Please sign in to comment.