Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2013, 12:34 PM   #1
holdit
Connoisseur
holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.holdit ought to be getting tired of karma fortunes by now.
 
Posts: 79
Karma: 470352
Join Date: Dec 2012
Device: Kindle Fire, IPad
Formatting a table question

I have an epub which is styled, passed validation and ready to go. However I need to add a page at the end of the book which is a table with images text and links on it. The original is a .docx which I converted to html and then imported the images and the html for the table. I assigned the stylesheet from the original and I have one problem. The table needs to be centered to line up with the rest of the book. How do I center the table and it's contents?
holdit is offline   Reply With Quote
Old 07-11-2013, 01:15 PM   #2
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
http://www.pigsgourdsandwikis.com/20...-ereaders.html

describes some ways to attempt this. The results are uneven depending on the reader.

I succeeded in doing it with my Sony, but it knocked out some of the lines in the table, in a table that needed them.

Be sure to check in the target reader whatever you do.
mrmikel is offline   Reply With Quote
Old 07-11-2013, 03:10 PM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,188
Karma: 7180223
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Keep the tables simple. They can be a hit-or-miss and are unpredictable.
Toxaris is offline   Reply With Quote
Old 07-11-2013, 03:34 PM   #4
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,140
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
A 6" screen doesn't allow much in the way of tables; consider if there's any way to rearrange your data.

Tables display poorly on most ereaders. If the contents of the full width of the table won't fit on the screen, different readers do odd things with them; if a cell won't fit on the screen, same problem. Some might allow scrolling, or set them on the next page, or delete them entirely from view.

Test tables on a couple of devices if you're making them for commercial ebooks.
Elfwreck is offline   Reply With Quote
Old 07-11-2013, 06:35 PM   #5
RbnJrg
Evangelist
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: 496
Karma: 318998
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by holdit View Post
...How do I center the table and it's contents?
Try using the following styles in your css stylesheet:

Code:
div.tab {
   display: block;
   width: 60%; /* here use the width you want */
   height: auto; /* Important: don't forget this property */
   margin-left: 20%;
}

table {
   width: 100%;
   text-align: center;
   border: 5px solid black;
}

td {
   margin: 0;
   padding: 0;
   text-indent: 0;
   text-align: center;
}
And in your .html sheet write:

Code:
<div class="tab">
    <table>
      <thead>
        <tr>
          <th>Lorem ipsum dolor sit amet</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>Nulla ac tellus nunc</td>
        </tr>

        <tr>
          <td>Phasellus imperdiet leo metus</td>
        </tr>

        <tr>
          <td>Donec metus ligula</td>
        </tr>

        <tr>
          <td>Etiam lobortis, massa ac aliquam auctor</td>
        </tr>
      </tbody>
    </table>
  </div>
This is a workaround for ADE and readers based on ADE, otherwise is not neccesary to include the table inside a "div" block. As you can see, the trick is not to center the table but the "div block" Once centered the "div block", we can fill it with the table.

To center the "div block" we need to fix a width for it (what you want) and after that to set a margin-left according to the width. This left margin must be equal to:

(100% - block width %) / 2

In the above example we have:

(100% - 60%) / 2 = 20%

Regards
Rubén
Attached Thumbnails
Click image for larger version

Name:	Image1.jpg
Views:	42
Size:	36.9 KB
ID:	108135  
Attached Files
File Type: epub Centered Table.epub (2.3 KB, 26 views)

Last edited by RbnJrg; 07-11-2013 at 06:37 PM.
RbnJrg is offline   Reply With Quote
Old 07-12-2013, 05:48 AM   #6
exaltedwombat
Evangelist
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 462
Karma: 1703930
Join Date: Nov 2011
Device: none
Quote:
Originally Posted by holdit View Post
I have an epub which is styled, passed validation and ready to go. However I need to add a page at the end of the book which is a table with images text and links on it. The original is a .docx which I converted to html and then imported the images and the html for the table. I assigned the stylesheet from the original and I have one problem. The table needs to be centered to line up with the rest of the book. How do I center the table and it's contents?
Is this for an eBook that you hope to publish and will be read on a range of different devices? If this layout is absolutely essential, create a whole-page graphic. Preferably, re-think the layout with the limitations of eBook in mind.
exaltedwombat is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table formatting Rob Vollman Sigil 28 06-23-2013 10:48 AM
Fictionwise Formatting - [Back to Table of Contents] JeremyR General Discussions 4 12-24-2010 11:10 AM
RTF to Mobi to Kindle: Table Border and Formatting are lost Starko Calibre 12 12-20-2010 06:46 AM
line formatting formatting question daesdaemar Workshop 9 02-06-2009 12:47 PM


All times are GMT -4. The time now is 01:13 AM.


MobileRead.com is a privately owned, operated and funded community.