View Single Post
Old 02-01-2023, 10:47 PM   #2
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,830
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by enuddleyarbl View Post
I guess this will be a learning experience. For the first time, I'm editing a play (just for tweaking to my tastes):

https://standardebooks.org/ebooks/os...-ideal-husband

Upon editing it, I found it was formatted as a table. I can see the draw of that, but I'd think that a Description List (<dl>) would be a better solution:

https://www.w3schools.com/tags/tag_dl.asp
Code:
<dl>
  <dt>CharacterA</dt>
  <dd>I think a Description List makes for a better structure for a play.</dd>
  <dt>CharacterB</dt>
  <dd>Dude!  No way.  Tables are where it's at.</dd>
</dl>
Is there any actual consensus about which is a better way to structure a play? Either way, I guess this gives me a chance to work on one of those methods (I hate tables, but have had almost no experience with description lists). Of course, I wonder if it's even possible to convert (easily) from one structure to the other. But, on the off-chance that I can, does anyone have any particularly good css for the formatting of a play's <dl>, <dt> and <dd>?
Well, there are more ways to get that structure, specially under epub3. But if you must work under epub2 and you hate tables, then the easiest is to work with <p> tags just as "normal" epubs. Of course, those <p> tags must have styled with the property "display: inline-block". For example:

A) In the .css stylesheet:

Code:
p {
    margin-bottom: 0;
}

.colOne {
    display: inline-block;
    width: 30%; /* here you can play with the value */
    padding-right: 3%;
    text-align: right;

/* Edit: I forgot to add this property */

    vertical-align: top; 
}

.colTwo {
    display: inline-block;
    width: 65%; /* here you can play with the value */
    text-align: left;
    margin-bottom: 0.5em; /* here you can play with the value */
}
B) In the .xhtml file:

Code:
<p class="colOne">Mr. Smith:</p>

<p class="colTwo">What do you think about this way of structuring a play?</p>

<p class="colOne">Mr. Brown:</p>

<p class="colTwo">I think I could give it a try.</p>

<p class="colOne">CharacterA:</p>

<p class="colTwo">But I think a Description List makes for a better structure for a play.</p>

<p class="colOne">CharacterB:</p>

<p class="colTwo">Dude!  No way.  Tables are where it's at.</p>
I am writing these lines from my smartphone and I can't check how the styles will work but I think they will work fine.

EDIT: It works fine!

Click image for larger version

Name:	Captura de pantalla_2023-02-02_08-23-36.png
Views:	130
Size:	182.8 KB
ID:	199400

Last edited by RbnJrg; 02-02-2023 at 06:27 AM.
RbnJrg is offline   Reply With Quote