Word vs writer: format changes in writer but not in word

LO=3.5/4.0 64bit
when i copy some data(Data=text with columns+rows) to Writer, the content gets spread to many pages and the same data when pasted to M$ word it gets fit to one page.

how do i overcome this. i have attach screen shot of both writer & M$ word

what i did till now: tried on LO 3.5+ubuntu, LO 4.0.3+win, used all paste special option but no luck.

lo1.jpg
lo2.jpg

What is the data source? Are you pasting content that is originally in a table? The result in LO looks like it is being pasted into a table in the document. The Paste Special option will treat the pasted content like plain text and not respect cell boundaries i.e., it will try and fit all the content into a single cell.

the content is an Air E-ticket which is in my thunderbird mail body which i am just trying to copy in new document(LO) where as in M$ word copy works fine in new document as u can see in image

Is the E-ticket a PDF or a HTML table in the email? It seems to me like this is a problem with the handling of HTML tables. Is there an example (HTML table) you can find on the internet that displays the same behaviour when pasting into Writer?

E-ticket is html based & i tried to copy some DATA but the result seems to be same whereas the paste special and normal paste gives the same output but in M$ it pastes proper format eg:http://tinyurl.com/bqwjsm5 i copied data from this site. there might be some workaround to overcome this …!!

It seems like writer is pasting into a nested table. A workaround might be to paste normally and then use the Table to Text function (Table → Convert → Table to Text [paragraph]).

didn’t helped that the whole layout/words gets here and there since it is an ticket…

I think the problem is how do you think:

Whether “retain format” OR “being reformatted” when imported into Document Processor.

Add an option is the only way.

The WHO table you link (in the comments) pastes fine into a Writer document here using either v3.5.7.2 or v4.0.2.2. Inspecting the code of the table shows it to be a typical plain HTML table with structure:

<table>
	<thead>
		<tr>
			<th>...</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>...</td>
		</tr>
	...etc...
	</tbody>
</table>

It has a few attributes for some of the elements, but nothing unusual. All I can suggest is: a) the table in your email is malformed; b) the HTML filter in LO may not be handling the particular HTML construction used in your table. Can you have a look at the HTML code in the email? See if has any spanned columns or unusual syntax.

EDIT: As a result of the provided source HTML (third comment below). I had a look at the HTML in the email and there are numerous issues. The structure and form of the code is really not great, which is what I guessed. Here are the main problems as I see them (and as the W3C Validator service reported them):

  • <?xml version="1.0" encoding="utf-16"?>: This initial declaration indicates probably XHTML 1.0 Transitional schema with UTF-16 encoding. I can’t see a reason for using UTF-16 encoding and so manually altered this to “utf-8” for validation purposes.
  • DOCTYPE: I said “indicates XHTML 1.0 Transitional schema” because there is no included DOCTYPE statement. The W3C Validator confirms this.
  • Errors: There are 35 errors ad 33 warnings reported, so it is definitely not valid markup. While many of the errors and warnings relate to missing “alt=” attributes and embedded PHP statements, there are several missing end tags and misplaced tags e.g., <td> element immediately after a <table> element. It is basically, rather poor code.
  • Code elegance: The excessive nesting of <table> elements within other <table> elements is ugly. There are six tables within each other in the first 40 lines of code and 29 tables in total. Good code would only have one <table> element and then divide the content as I indicated above: separate head and body areas with rows and cells in each. There are no <thead> or <tbody> elements at all. Web browsers are very forgiving of these types of omissions. LO may not be as forgiving because it has to translate this mess into a valid XML schema.

My (very basically) cleaned version of the HTML is here. Save it to a *.html file, open it in a browser, and copy / paste into Writer. It should paste much as before. With respect to your initial problem of the content appearing to paste in a tall thin manner, this appears to be due to the left and right graphical end-parts of the ticket display. There are other parts of the ticket that do not position well, when compared with the browser HTML, but these two parts are the worst.

Both images after pasting into Writer are set to a relative height of ~4-6% (right click on the graphic > Picture… > Type tab). While each image is set within a <td> element immediately after a <table> element (i.e., one of the errors mentioned), LO appears to be forgiving of this. What LO is less forgiving about is that both images have height="100%" specified, which should be either an exact value (the height of the graphic) or height="auto". Editing these values, as in this HTML results in a significantly cleaner result. This is one of many, many such problems with the HTML in the e-ticket.

Overall, the answer as to why your e-ticket will not paste under LO, like it does under Word, is probably because Word is more forgiving of poor code.

many thanks for reply !! HTML code in email(thunderbird) is same what you have posted. request you to find 2 attachment which i have created in M$ and LO 4.0 http://temp-share.com/show/KdPf2U5Fh http://temp-share.com/show/dPf3aC4HW i have copied data from yahoo mail. can you look the difference in LO which got pasted weirdly

I had a look at the documents and neither are very pretty in terms of layout, but I can see what you mean about the initial four boxes displaying better in the Word version. Unfortunately, this is likely to be a case of quite poorly defined / structured HTML in the original email, however without the source HTML, there is little else that can be suggested. Even with it we may not be able to suggest a solution, but it may help identify the problem source.

hi…oweng please find the source of mail in case you can find some information about html table http://pastebin.com/LA3FkdSX if you want I can forward the same Email to your email id.

Thanks for providing the source HTML. I have edited my answer to provide a clear reason as to why it is likely not pasting correctly.

thanks oweng !! i have understood the issue so finally i have to do manually adjustment before giving print