View Single Post
Old 06-26-2025, 05:44 PM   #10
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,874
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
The solution by enuddleyarbl is very good but if you want to insist on your own list and numbering, use the following code, which is valid even for epub2:

1. In your .xhtml file:

Code:
  <p class="list"><span class="col1">1(a.i)</span><span class="col2">This is the text for the first item in the list</span></p>

  <p class="list"><span class="col1">1(a.ii)</span><span class="col2">This is the text for the second item in the list</span></p>

  <p class="list"><span class="col1">1(a)</span><span class="col2">This is the text for the first item in the list</span></p>

  <p class="list"><span class="col1">1(b)</span><span class="col2">This is the text for the second item in the list</span></p>
2. In your .css stylesheet:

Code:
p.list {
  margin: 0;
}

.col1 {
  display: inline-block;
  width: 15%; /* you can play with this percentage */
  padding-right: 10px; /* you can play with the padding value */
  margin: 0;
  vertical-align: top;
  text-align: right;
}

.col2 {
  display: inline-block;
  width: 76%; /* you can play with this percentage */
  padding: 0;
  margin: 0 5% 1em 0; /* you can play with the margin-right percentage */
  vertical-align: top;
  text-align: justify;
}
Here you have a screenshot:

Click image for larger version

Name:	One1.jpg
Views:	415
Size:	23.2 KB
ID:	216520

Take into account that the percentage of .col1 plus percentage of .col2 plus percentage of margin-right must be lower than 99% (because of the padding of .col1). Of course, this aproximation under epub2 is very sensitive to changing the font size. You can minimize this danger by increasing the size of the first column and reducing the size of the second. To get a dinamic layout to automatically change column widths as the font size changes, you need to work in epub3. Below you can check the respective epub2.
Attached Files
File Type: epub Lists.epub (2.1 KB, 448 views)

Last edited by RbnJrg; 06-26-2025 at 05:59 PM.
RbnJrg is online now   Reply With Quote