View Single Post
Old 03-26-2011, 04:51 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,550
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by norway1456 View Post
The main goal is that the table of contents shall look exactly like the printed version, but I want to use semantically correct coding as well. I can easily create this layout in a table, but I have my doubt that a table is the best way, semantically speaking, to represent the contents of a book.
Well, "exactly like" is probably something you won't get, page sizes and font sizes in the printed book will not match screen sizes and font sizes in the ebook (if only because in the ebook they can be changed by the user).

Otherwise, I agree with ATDrake that a table seems OK here

Quote:
I have tried an ordered list (<ol>), but ran into problems with the chapter numbers beginning at 1 again in the second list (I need to have one list of chapters for each section), and have had problems with not being able to set the start value of an <ol>.
Lists are fine for webpages, but I avoid them in books (at least in non-technical books). They don't have enough flexibility in the current specs.

Quote:
I have also tried to use spans and format each part (the chapter numbers in one span, chapter title in another and page number in a third), and use different css-codes (by adjusting float, display:block, display:inline-block,adjust margins and so on) to make something that looks correct in a browser. I have not yet tried packing it as .epub.
That could be my choice... if the ePUB spec supported inline-block.

What you could do is use the table-* display values for your divs and spans. This should give an equivalent result to a table, but you are not coding directly a table, and you could change the layout just by altering the CSS.
Jellby is offline   Reply With Quote