View Single Post
Old 07-18-2022, 02:04 PM   #4
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,641
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by DaveLessnau View Post
...
and for cellpadding="5", cellspacing="5" style, I'd need styles changing table border-spacing=5px and td, th padding:5px.

Does that sound reasonable?
That's right. The css property for cellspacing is "border-spacing" and the property for cellpadding is "padding".
In epub2 is allowed to use for example:

Code:
<table cellpadding="5" cellspacing="5" border="1">
    <tbody>
      <tr>
        <td>Hi,</td>

        <td>how are you?</td>
      </tr>
    </tbody>
</table>
Under epub3, the above code will give you errors with epubcheck. So, to mimic under epub3 that table layout, you should employ:

Code:
<table class="padspace" border="1">
    <tbody>
      <tr>
        <td>Hi,</td>

        <td>how are you?</td>
      </tr>
    </tbody>
</table>
and in your .css stylesheet:

Code:
.padspace {
    border-spacing: 5px;
    border-collapse: separate;
}

.padspace td {
    padding: 5px;
}
Of course, in order that the property "border-spacing" will work, "border-collapse" must take the value "separate". With "border-collapse: collapse", the property "border-spacing" won't have any effect. And you also could use:

Code:
<table class="padspace">
    <tbody>
      <tr>
        <td>Hi,</td>

        <td>how are you?</td>
      </tr>
    </tbody>
</table>
and in your .css stylesheet:

Code:
.padspace {
    border: 3px solid black;
    border-spacing: 5px;
    border-collapse: separate;
}

.padspace td {
    border: 1px solid black;
    padding: 5px;
}
to have control over the borders.
RbnJrg is offline   Reply With Quote