View Single Post
Old 01-16-2016, 09:23 AM   #6
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,827
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by democrite View Post
Thank you Jellby. That looks perfect. ADE didn't like it very much, and iBooks had a slight indent for the title which I might have been able to fix with adjusting the left margin.

A hanging indent did end up working.

Code:
div.sgc-toc-level-2 	{ text-indent:0; margin-left:5.5em }
.num 			{ width:5.5em; text-align:right; float:left; padding-right:.5em; margin-left:-6em }
https://jsfiddle.net/znwbre26/2/
Hmmm, what about using a table for that? A two column table with "text-align: right" for the first column and "text-aling: left" for the second column could work. For example this code works fine under ADE:

Code:
td {
   text-align: left;
   vertical-align: top;
}

td.first {
   text-align: right !important;
}
and

Code:
  <table width="100%" cellspacing="10" cellpadding="0" border="0">
    <tr>
      <td class="first">I.&nbsp;—&nbsp;</td>

      <td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus.</td>
    </tr>

    <tr>
      <td class="first">II.&nbsp;—&nbsp;</td>

      <td>Title</td>
    </tr>

    <tr>
      <td class="first">III.&nbsp;—&nbsp;</td>

      <td>Title</td>
    </tr>

    <tr>
      <td class="first">…</td>

      <td>&nbsp;</td>
    </tr>

    <tr>
      <td class="first">XXXVIII&nbsp;—&nbsp;</td>

      <td>Title</td>
    </tr>
  </table>
Here there are two screenshots of ADE (with different font-size):

Click image for larger version

Name:	Image1.png
Views:	275
Size:	33.3 KB
ID:	145589 Click image for larger version

Name:	Image2.png
Views:	276
Size:	43.5 KB
ID:	145590

Below you can check the respective epub.

NOTE: As you can see, I styling "inline" the table; that is because ADE has "issues" with styling tables with code in the .css stylesheet.

Regards
Rubén
Attached Files
File Type: epub Aligned chapter numbers in a TOC.epub (2.3 KB, 275 views)
RbnJrg is offline   Reply With Quote