|  06-18-2010, 11:29 AM | #106 | |
| Resident Curmudgeon            Posts: 80,727 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | Quote: 
 I've not seen any use of page-template (yet) that could not be done in CSS. | |
|   |   | 
|  06-18-2010, 12:16 PM | #107 | ||
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | Quote: 
  Wouldn't it just be easier to edit the page-template to make it "empty"? That way you don't need to remove every reference to it. I don't know if a truly empty file would work, but something like this probably would: Code: <ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format"> </ade:template> Quote: 
 | ||
|   |   | 
|  06-20-2010, 11:19 PM | #108 | 
| Evangelist            Posts: 435 Karma: 24326 Join Date: Jun 2010 Device: Kobo | 
				
				Pretty Chapter Heading
			 
			
			I won't claim to have thought this up myself.  It draws a nice box around the header, with a big number and a subtitle for the chapter: Code: .chapterHeader {
  height:60px;
  border:1px solid #000;
  display:block;
  margin-bottom:20px;
  background-color:#FFF;}
  
.chapterHeader .translation {
  float:left;
  font-weight: normal;
  margin-top:38px;
  margin-left: -8px;
  margin-bottom: 0px;
  padding-right: 16px;
  padding-left: 5px ;
  padding-bottom: 0px;
  padding-top: 0px;
  font-size:26px;
  background-color:#FFF;}
                             
.chapterHeader .count {
  line-height: 100%;
  font-style:normal;
  font-weight: normal;
  text-transform:uppercase;
  font-size:94px;
  margin-right:18px;
  margin-top:-14px;
  margin-bottom: -20px;
  float:left;
  padding:0px;
  background-color:#FFF;}Code:   <div class="body chapter" id="chapter">
    <h2 id="heading_id_2"><span class="chapterHeader"><span class="translation">Chapter</span> <span class="count">1</span></span> Chapter Subtitle</h2> | 
|   |   | 
|  10-06-2010, 03:35 AM | #109 | 
| Connoisseur            Posts: 92 Karma: 50000 Join Date: Oct 2009 Device: none | 
			
			Hey! It's me again.. This time problems with centering a table. How can I center my table easily and simply? I tried using:  Code: table.center {
        margin-left:auto; 
        margin-right:auto;
} | 
|   |   | 
|  10-06-2010, 06:26 AM | #110 | 
| Chocolate Grasshopper ...            Posts: 27,599 Karma: 20821184 Join Date: Mar 2008 Location: Scotland Device: Muse HD , Cybook Gen3 , Pocketbook 302 (Black) , Nexus 10: wife has PW | 
			
			could be epubs are not designed for tables ....    | 
|   |   | 
|  10-06-2010, 06:56 AM | #111 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			That's the way, but ADE just doesn't support "auto" margins    | 
|   |   | 
|  10-06-2010, 06:58 AM | #112 | 
| GuteBook/Mobi2IMP Creator            Posts: 2,958 Karma: 2530691 Join Date: Dec 2007 Location: Toronto, Canada Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN | |
|   |   | 
|  10-06-2010, 09:50 AM | #113 | 
| Groupie            Posts: 165 Karma: 339490 Join Date: May 2010 Device: nook, BlackBerry | 
			
			Unfortunately, the standard allows this behaviour, which is one of the differences between OPS and XHTML/CSS. The standard reads "Reading Systems may set the value of any margin property whose specified value is auto to 0." See footnote 1 in section 3.3.   You can get around it by putting your content inside a table block that has been centred. See this thread for some work-arounds. Last edited by EricDP; 10-06-2010 at 09:55 AM. | 
|   |   | 
|  10-13-2010, 12:58 PM | #114 | 
| speaking for myself            Posts: 139 Karma: 2166 Join Date: Feb 2008 Location: San Francisco Bay Area Device: PRS-505 | |
|   |   | 
|  10-13-2010, 01:00 PM | #115 | 
| speaking for myself            Posts: 139 Karma: 2166 Join Date: Feb 2008 Location: San Francisco Bay Area Device: PRS-505 | 
			
			It is certainly not a good idea to use page template just for margins. These should be specified using regular margins on body and @page rule.
		 | 
|   |   | 
|  10-13-2010, 01:32 PM | #116 | |
| Groupie            Posts: 165 Karma: 339490 Join Date: May 2010 Device: nook, BlackBerry | Quote: 
 Why can't publishers realize that their trade-paperback edition and hardcover edition margins just don't work on a 6" screen? Doesn't anybody proof these books on an actual reading device? | |
|   |   | 
|  10-13-2010, 01:46 PM | #117 | ||
| GuteBook/Mobi2IMP Creator            Posts: 2,958 Karma: 2530691 Join Date: Dec 2007 Location: Toronto, Canada Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN | Quote: 
 Quote: 
  Centering simple tables (like the TOC in many Project Gutenberg books) should be provided for, and I know workarounds can be used to properly center images, while centering headings using <h1> and similar constructs has always worked like a charm!  When the device's width is known, then centering should just be an algebraic exercise when you know the "extent" (max.) width of the table and/or image. Though I can understand that tables can be arbitrarily complex and not yield it's extent width easily, simple tables should be rendered centered if so specified...   Last edited by nrapallo; 10-13-2010 at 01:49 PM. | ||
|   |   | 
|  10-13-2010, 03:15 PM | #118 | 
| Groupie            Posts: 165 Karma: 339490 Join Date: May 2010 Device: nook, BlackBerry | 
			
			Tables can be centered, you just need to make them 'inline'. Make a div with 'text-align: center'. Make your table 'display: inline-table' and it will be centered as if it were text. The only problem is, as an inline element, it can't break across pages - the entire table is treated as a single character of text.
		 | 
|   |   | 
|  10-13-2010, 05:04 PM | #119 | |
| GuteBook/Mobi2IMP Creator            Posts: 2,958 Karma: 2530691 Join Date: Dec 2007 Location: Toronto, Canada Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN | Quote: 
  That's good to know!!! It is the same answer given in another thread where I struggled with the centering of tables called eBooks of chess problems. Center table bug?  It seems I remember this problem quite distinctly, but somehow forgot it's  solution, i.e. 'display: inline-table'   Last edited by nrapallo; 02-22-2011 at 02:09 PM. | |
|   |   | 
|  10-13-2010, 05:33 PM | #120 | |
| GuteBook/Mobi2IMP Creator            Posts: 2,958 Karma: 2530691 Join Date: Dec 2007 Location: Toronto, Canada Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN | Quote: 
 Oh, that's a big problem with lengthy TOC or List of Illustrations found in some PG ebooks, like Etext #28700 that I have uploaded before to my GuteBook thread. I re-generated the .epub version and attached it below, this time inserting your suggested code, namely: Code: table {
    display: inline-table;
} /* work around for ADE centering with CSS problem */ Any better solutions...   | |
|   |   | 
|  | 
| 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 |