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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-01-2009, 02:53 PM   #1
Tibor
Enthusiast
Tibor began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jan 2009
Device: Sony PRS-505
eBooks of chess problems. Center table bug?

Hi,

I am developing a tool to generate an ePub ebook with chess problems to solve. I have nearly finished, and now I am having a small problem with epub presentation.

The ePub file I attach has been made with a development version of the tool. If you unzip the files, you will see the xhtml files are showed correctly in browsers. Also, if you open the ePub file with calibre eViewer the content is showed correctly.... but if I open the eBook in Adobe Digital Editions or in the Sony PRS505, the board is left justified.

I have tried to replace deprecated "<center>" tag with CSS and the problem continue. The board appears in the left.

Download at: http://rodin.chess.googlepages.com/tmp.epub

Does anybody know what can I do in order to get proper board aligment?

P.S.: xhtml files has been code checked in w3.org (html and css)
Tibor is offline   Reply With Quote
Old 03-01-2009, 03:14 PM   #2
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,956
Karma: 2530531
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by Tibor View Post
I have tried to replace deprecated "<center>" tag with CSS and the problem continue. The board appears in the left.

Download at: http://rodin.chess.googlepages.com/tmp.epub

Does anybody know what can I do in order to get proper board aligment?

P.S.: xhtml files has been code checked in w3.org (html and css)
Try surrounding the <table> describing the chessboard with <div class="docenter"> ... </div> and adding the "docenter" style (in bold) to the <style> section:
Code:
<style type="text/css">
.docenter { text-align: center }
span { font-family: "DBChess", serif }
#wrap {
     margin: 0 auto; /* margin 0 auto will center that box in your document */
     width: 600px; /*size of your box*/
     background: #fff;
     text-align: center; /* everything will be written in that box will be centered horizontaly*/
     }
</style>
The depreciated <div align="center"> may also work.

I tried this with my reader's .imp format and it worked. Your mileage may vary...
Attached Thumbnails
Click image for larger version

Name:	center.jpg
Views:	318
Size:	65.2 KB
ID:	24716  

Last edited by nrapallo; 03-01-2009 at 03:21 PM. Reason: added image
nrapallo is offline   Reply With Quote
Old 03-01-2009, 03:33 PM   #3
dschill
Connoisseur
dschill began at the beginning.
 
Posts: 51
Karma: 12
Join Date: Mar 2009
Device: none
nice i wanna try this out when your done!
dschill is offline   Reply With Quote
Old 03-01-2009, 04:40 PM   #4
Tibor
Enthusiast
Tibor began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jan 2009
Device: Sony PRS-505
Quote:
Originally Posted by nrapallo View Post
Try surrounding the <table> describing the chessboard with <div class="docenter"> ... </div> and adding the "docenter" style (in bold) to the <style> section:
Code:
<style type="text/css">
.docenter { text-align: center }
span { font-family: "DBChess", serif }
#wrap {
     margin: 0 auto; /* margin 0 auto will center that box in your document */
     width: 600px; /*size of your box*/
     background: #fff;
     text-align: center; /* everything will be written in that box will be centered horizontaly*/
     }
</style>
The depreciated <div align="center"> may also work.

I tried this with my reader's .imp format and it worked. Your mileage may vary...
I have tried both and it does not work. It look like a bug in ADE and the Sony reader....

any other ideas??
Tibor is offline   Reply With Quote
Old 03-01-2009, 05:40 PM   #5
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,956
Karma: 2530531
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by Tibor View Post
I have tried both and it does not work. It look like a bug in ADE and the Sony reader....

any other ideas??
If you give the <table> a boundary, then it can be centered. Try wrapping the <table> or that <div> with a <p class="docenter">. Experiment with the ordering/nesting.

If all else fails, then try altering the <body> tag to have everything centered. i.e. <body style="text-align: center">. Worth a try.
nrapallo is offline   Reply With Quote
Old 03-01-2009, 05:57 PM   #6
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
It renders properly if you force the outermost table to be 'display: inline-table'. For example, by adding a rule like
Code:
#wrap > table {
     display: inline-table;
}
to your CSS. (I would recommend instead giving your chess-problem tables a semantic @class attribute and hanging the CSS rule off of that, as well as ditching the nested tables and using CSS for everything except the board layouts, but YMMV.)
llasram is offline   Reply With Quote
Old 03-05-2009, 09:20 AM   #7
Tibor
Enthusiast
Tibor began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jan 2009
Device: Sony PRS-505
Quote:
Originally Posted by dschill View Post
nice i wanna try this out when your done!
Hi,

I have a beta version. Any feedback would be wellcome.
Please, read readme.txt file to run.

http://rodin.chess.googlepages.com/cpegen-v1.0.zip
Tibor is offline   Reply With Quote
Reply

Tags
center table problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of contents problems Shiren ePub 2 03-18-2010 07:51 AM
Who can help me? html2xxx => Chess problems Tibor Workshop 8 03-01-2009 06:08 PM
chess ebooks please help me dandan77 Sony Reader 22 01-26-2009 08:45 PM
Problems with Table of Contents davers Sony Reader 3 12-25-2008 09:02 PM
Everyman chess ebooks (Chessbase format) Sparrow News 24 09-19-2008 04:47 PM


All times are GMT -4. The time now is 02:45 AM.


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