Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-29-2015, 08:11 AM   #1
User7
Member
User7 began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2015
Device: none
Unhappy Copy-Paste table from Word = Errors

Hello, when pasting a table and keeping format from a Word document, the coding has many errors. Am I doing something wrong or just table pasting is not the way to go (because the result looked great even in other epub viewers)
User7 is offline   Reply With Quote
Old 12-29-2015, 08:37 AM   #2
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
A faster reply could be possible if more information was given. "There are many coding errors" isnt very helpful.
rubeus is offline   Reply With Quote
Advert
Old 12-29-2015, 08:42 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,364
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Pasting formatted content from Word into Book View will work--as you've found out. But that doesn't mean the code that results will automatically be epub-spec valid. You've not mentioned what the errors were, by the way, so I'm assuming they're validation errors/warnings of some kind and not, in fact, well-formed errors.

I'm admittedly biased on the subject of Book View editing, so I would definitely say that table-pasting from Word into Book View is not the way to go. Others' mileage may vary, of course.

I would suggest saving the entire Word document as filtered html and importing that into a Sigil epub--or better yet, using Toxaris' Word add-in--rather than copy/pasting formatted data from Word to Sigil.
DiapDealer is online now   Reply With Quote
Old 12-29-2015, 09:48 AM   #4
User7
Member
User7 began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2015
Device: none
Quote:
Originally Posted by rubeus View Post
A faster reply could be possible if more information was given. "There are many coding errors" isnt very helpful.
Quote:
Originally Posted by DiapDealer View Post
Pasting formatted content from Word into Book View will work--as you've found out. But that doesn't mean the code that results will automatically be epub-spec valid. You've not mentioned what the errors were, by the way, so I'm assuming they're validation errors/warnings of some kind and not, in fact, well-formed errors.

I'm admittedly biased on the subject of Book View editing, so I would definitely say that table-pasting from Word into Book View is not the way to go. Others' mileage may vary, of course.

I would suggest saving the entire Word document as filtered html and importing that into a Sigil epub--or better yet, using Toxaris' Word add-in--rather than copy/pasting formatted data from Word to Sigil.
For every table paste these errors appear many times:
attribute 'align' is not declared for element 'p'
attribute 'width' is not declared for element 'td'

I'll try those 2 suggestions DiapDealer thank you
User7 is offline   Reply With Quote
Old 12-29-2015, 09:57 AM   #5
User7
Member
User7 began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2015
Device: none
The 1st method (importing filtered html code) had the same results with an additional error
attribute 'type' is not declared for element 'ui'
User7 is offline   Reply With Quote
Advert
Old 12-29-2015, 12:22 PM   #6
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
epub is XHTML with a subset from CSS 2. If you paste code outside these specifications its completely normal that you get errors.
rubeus is offline   Reply With Quote
Old 12-29-2015, 12:31 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
Depending on what version of epubcheck you are using width is not longer a legal attribute on a table td tag. Instead the spec calls for using css either as inline styes or in an external css file.

Here is one approach to fixing this by example:
Code:
<table width="100%">
  <tr>
    <td width="80%">Foo</td>
    <td width="20%">Bar</td>
  </tr>
</table>
The width attribute is no longer present in HTML5. Use CSS instead:

Code:
<table style="width:100%;">
  <tr>
    <td style="width:80%;">Foo</td>
    <td style="width:20%;">Bar</td>
  </tr>
</table>
Similar things are true for align attributes on a p-tag.

The correct way to handle this for html5 is:

Code:
<p style="text-align:right">
This way of handling it is correct for all html4 and 5.

Last edited by KevinH; 12-29-2015 at 12:37 PM.
KevinH is offline   Reply With Quote
Old 12-29-2015, 01:18 PM   #8
User7
Member
User7 began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2015
Device: none
Quote:
Originally Posted by KevinH View Post
...
Thanx Kevin! That really helped since Im new to this.
The problem was when pasting a table, the width attribute appeared twice in the code (example):
Code:
<td width="130" valign="top" style="width:97.55pt;border:solid white 1.0pt;...etc
and deleting width="130" worked like a charm!
While with align I got (example):
Code:
<p class="MsoNormal" align="left"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;...etc
and deleting align="left" didn't affect the table appearance as well.
User7 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy PAste Fizzyfi Calibre 2 04-10-2015 02:55 PM
Copy/Paste PalingB Sigil 10 10-15-2014 03:17 PM
Copy and Paste JDavid Sigil 4 08-23-2012 04:02 PM
Copy Paste giosa Sony Reader Dev Corner 0 03-24-2012 06:17 PM
Copy and Paste Gunnerp245 enTourage eDGe 1 04-03-2010 02:45 PM


All times are GMT -4. The time now is 05:59 PM.


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