|  09-04-2011, 12:56 PM | #151 | 
| Zealot            Posts: 128 Karma: 238654 Join Date: Aug 2009 Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader) | 
				
				Multi Part Chapter Headers Using HTML Tables
			 
			
			I was looking for a way to have multiple items in a single line header (book# section# chapter#) spread out over the full width of the page and figured out a way to do it using a html table. It works well in everythin I could test it in (nook classic, Bluefire Reader on my iPod Touch, Calibre, the Firefox ePub Reader, ADE 1.7.2 and 1.8 preview, and Sony Reader Library). And it converts decently to mobi using Kindlegen. Here's the html code. Code:   <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td class="leftgrey">BOOK #</td>
      <td class="centergrey">Section #</td>
      <td class="right">Chapter #</td>
    </tr>
  </table>
  <hr />Code:  table  { 
margin-top : 2em; 
margin-bottom : 0;
 }
 td  { 
font-family : sans-serif; 
font-size : 1.5em; 
width : 33%; 
 } 
 .left  { 
text-align : left; 
 } 
 .leftgrey  {         /* --- Use for greying out unchanging items --- */
text-align : left; 
color : #cccccc; 
 } 
 .center  { 
text-align : center; 
 } 
 .centergrey  {      /* --- Use for greying out unchanging items --- */ 
text-align : center; 
color : #cccccc; 
 } 
 .right  { 
text-align : right; 
 } 
 hr  { 
margin-top : 0; 
border : 0; 
background-color : black; 
height : 3px; 
 } | 
|   |   | 
|  09-07-2011, 07:48 AM | #152 | 
| Addict            Posts: 201 Karma: 266070 Join Date: Dec 2010 Location: Spain Device: Win10,Win11,Ubuntu,PockbookLux44 | 
			
			Thanks.  Another point: DO or DO NOT most readers react to the addition of font-family for small-caps? Thanks again. | 
|   |   | 
|  09-07-2011, 09:59 AM | #153 | 
| Wizard            Posts: 4,520 Karma: 121692313 Join Date: Oct 2009 Location: Heemskerk, NL Device: PRS-T1, Kobo Touch, Kobo Aura | 
			
			Most readers ignore smallcaps at the moment.
		 | 
|   |   | 
|  09-07-2011, 02:23 PM | #154 | 
| Zealot            Posts: 103 Karma: 57138 Join Date: May 2010 Device: Sony 505, iPad 1 & 3, Galaxy Note 8.1 | 
			
			iBooks handles small-caps but one thing I noticed, if you set font-size: 1em and use small-caps, they won't display properly but setting the font-size of the small-caps to 1.1em or 0.9em and suddenly they work.
		 | 
|   |   | 
|  09-07-2011, 03:18 PM | #155 | 
| Addict            Posts: 201 Karma: 266070 Join Date: Dec 2010 Location: Spain Device: Win10,Win11,Ubuntu,PockbookLux44 | 
			
			Tanks -- information always of value when editing.
		 | 
|   |   | 
|  09-09-2011, 08:36 AM | #156 | 
| Grand Sorcerer            Posts: 11,470 Karma: 13095790 Join Date: Aug 2007 Location: Grass Valley, CA Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7 | |
|   |   | 
|  09-21-2011, 08:00 AM | #157 | 
| Enthusiast  Posts: 25 Karma: 10 Join Date: Sep 2009 Location: Tennessee Device: Kobo Aura HD | 
			
			My apologies if this is old hat to everyone, but it is new to me. I've always been a little bothered by "quoted quotes" in epubs - when you've got a character speaking, and he's quoting something else. Having a double quote followed immediately by a single quite looks pretty bad, to me; it looks like a triple quote in most epubs I've seen. Putting a space between the double quote and single quote also looks pretty bad to me. It occurred to me on my drive home this morning that I could fix that with css. Code: .space
{margin-left: 2pt;
}Code: <p>"<span class="space">'</span></p> I haven't decided yet if I'm OCD enough to start doing this in all my books. | 
|   |   | 
|  09-21-2011, 09:30 AM | #158 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			I've always thought that this should be handled by font kerning...
		 | 
|   |   | 
|  09-21-2011, 10:16 AM | #159 | |
| The Grand Mouse 高貴的老鼠            Posts: 74,432 Karma: 318076944 Join Date: Jul 2007 Location: Norfolk, England Device: Kindle Oasis | Quote: 
 | |
|   |   | 
|  09-21-2011, 10:59 AM | #160 | 
| Grand Sorcerer            Posts: 11,470 Karma: 13095790 Join Date: Aug 2007 Location: Grass Valley, CA Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7 | 
			
			Nice solution. I had thought of using CSS with letter-spacing to fix this problem and then set the span to the full " ' combination since it can also be ' " then there is also things like " ' ". Dale | 
|   |   | 
|  09-22-2011, 03:30 AM | #161 | |
| Enthusiast  Posts: 25 Karma: 10 Join Date: Sep 2009 Location: Tennessee Device: Kobo Aura HD | Quote: 
 Do most epub readers recognize the letterspacing attribute? I didn't even know that existed until just now - I'll have to do some testing with it later. It would certainly be easier to do it that way than to create one for " ' and another for ' ". | |
|   |   | 
|  09-22-2011, 04:04 AM | #162 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			Or you could add one of the different non-breaking spaces available in Unicode:   -> Normal size, although it usually does not expand with other normal spaces when the line is justified. & #8199; -> Figure space, shouldn't be much different from  . & #8239; -> Narrow no-break space. I'd favour this one. & #8288; and & #65279; -> These are zero-width, and have other uses. | 
|   |   | 
|  03-26-2012, 08:47 AM | #163 | 
| Wizard            Posts: 2,625 Karma: 3120635 Join Date: Jan 2009 Device: Kindle PW3 (wifi) | 
			
			@Jellby About & #8239; -> Narrow no-break space. " This char is also used in French before ";?!»" chars and after "«". " As a French, this space entity interests me a lot of course. It's what we call or close to "espace fine insécable". However I can see no way to use it for EPUB purposes. Sigil erases it immediately, ADE will probably flag it with a question mark as it did with   (this last one at least is recognized by Sigil) ) It seems we need special software to handle this? But how can we expect to transfer it to ebook-readers which follow ADE specifications? This has always puzzled me. Emulation, though possible, seems to be too cumbersome for these small animals. texte<span class=*»fine*»>nbsp</span>texte Related CSS*code: .fine {font-size: 30%; } If you could provide some more comments on this, I would be very interested.   Last edited by roger64; 03-26-2012 at 08:57 AM. | 
|   |   | 
|  03-26-2012, 11:11 AM | #164 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			I don't know what Sigil does, but my reader (Cybook Orizon, which uses an Adobe engine internally) supports it fine, at least with the fonts I use.
		 | 
|   |   | 
|  03-26-2012, 12:12 PM | #165 | ||
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 Join Date: Jan 2010 Device: Nexus 7, Kindle Fire HD | Quote: 
 The regex expression \x{202f} will find all occurrences of the narrow, non-breaking spaces that you thought were erased (in Code View). This is all based on Sigil 0.5.3. Quote: 
 | ||
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| direkter Umlaut oder lieber HTML Code in Epub ? | NASCARaddicted | Erste Hilfe | 14 | 06-16-2011 05:54 AM | 
| Programming language code snippets in ebooks? | Connochaetes | Writers' Corner | 7 | 10-18-2010 02:43 PM | 
| ebook-convert HTML to EPUB and problem with <pre><code> | mikegr | Calibre | 2 | 03-09-2010 02:27 PM | 
| css override code for margins? | Amalthia | Calibre | 15 | 08-11-2009 07:20 PM | 
| Problems generating ePub from HTML/CSS | AlexBell | Calibre | 3 | 07-17-2009 05:10 AM |