Git Product home page Git Product logo

Comments (1)

JayPanoz avatar JayPanoz commented on June 11, 2024

That’s right.

Actually this appears to be subdocumented in the spec.

I consequently created a very quick test in order to come with an explanation:

<!DOCTYPE html>
<html>
<head>
  <title>Table Padding Test</title>
  <style>table {
    table-layout: auto;
    border: 1px solid;
    border-collapse: collapse;
  }
  td {
    border: 1px solid;
    padding: 10px 5%;
  }</style>
</head>
<body>
<table>
  <tr>
    <th>type</th>
    <th>values</th>
  </tr>
  <tr>
    <td>Font Family</td>
    <td>sans-serif | serif | monospace</td>
  </tr>
  <tr>
    <td>Font Size</td>
    <td>number in px</td>
  </tr>
  <tr>
    <td>Theme</td>
    <td>Light | Sepia | Dark</td>
  </tr>
  <tr>
    <td>Rendition</td>
    <td>reflowable | pre-paginated | paginated | scrolled-continuous | scrolled-doc | align-x-center | …</td>
  </tr>
</table>

<button type="button">Relayout</button>

<script>
  const trigger = document.querySelector("button");
  const relayoutStyle = document.createElement("style");
  relayoutStyle.id = "relayout";
  document.head.appendChild(relayoutStyle);
  const stylesheet = document.head.querySelector("#relayout");
  trigger.addEventListener("click", (e) => {
    e.preventDefault();
    stylesheet.textContent = `body {font-size: 100%;}`;
  }, false);
</script>
</body>
</html>

Turns out we never encountered the issue in testing because the Reading Systems we used are forcing a relayout e.g. applying their own styles, user settings, pagination, etc. That like even happens with a “poor-man’s pagination” stylesheet of mine.

If you’re clicking the relayout button in Webkit/Blink, the table will be laid out again but this time with the correct padding. In Firefox, it won’t – I can’t wait for the guys @ Microsoft to finish documenting all the table issues so that browsers can come up with a semblance of compat.

However this is the awful side effect of an EPUB’s idiosyncrasy, and not a voluntary trick – which would be really bad – so I’ll switch back to px. Thanks for asking!

from blitz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.