[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Copy and Paste HTML Problems

Posted on 2012-08-16
18
Medium Priority
?
799 Views
Last Modified: 2012-08-28
We have some MS aspx pages that display text on a screen in a layout using tables. The page uses a style sheet plus inline styles. The main table is typically width=580.

It displays and prints properly, but when I copy and pastes into an Outlook 2010 HTML email, it becomes very wide and short, extending off the page to the right with scroll bars.

If I paste it into Word it expands to fit the left/right margins.

Seems to me it is ignoring the table width.
0
Comment
Question by:4ncid
  • 8
  • 5
  • 3
  • +2
18 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38300785
Most CSS does not work in email clients.  Some of the inline stuff will work. Stylesheet are generally ignored.  Depending on user setting HTML may not display at all.


Cd&
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38300800
Do you have source code / html code we can look at?
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 38300895
What happens when you paste it into Word, ...then copy from Word to an e-mail?
You may also try pasting into Excel first, ....then copy paste from there to the email.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:4ncid
ID: 38301009
Thanks for replies. The solution has to be easy for users - they will not do mutiple steps.

The table width setting is visible in Page Source. I will post screen shot and page source.
0
 

Author Comment

by:4ncid
ID: 38301013
0
 

Author Comment

by:4ncid
ID: 38301298
0
 
LVL 33

Expert Comment

by:Paul Sauvé
ID: 38301560
I copied the page (case-search.htm) and pasted to Word 2010:Copy to Word.Here is the file:4NCrecordson-8.docxOf course, it is not from the Internet site, sit is difficult to say what the result will be. But if you choose View tab -> Document Views -> Print Layout, you MAY get the same result.
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38301587
Not enough to go on there.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38301694
In addition to the problem of styles in the head being ignored, the non-breaking spaces will not format as space except in a browser interface.

Cd&
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 500 total points
ID: 38301715
I think you need to try an format it as a text file, instead of trying to tag with html.  A text file will retain whatever formatting you give it when it goes into the email client.

Cd7
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38301749
Just to clarify - are you trying to fix the problem or are you trying to devise a process to copy the data out of the page in a form that you can use it?

If it is just a case of defining a copy process then following on from COBOLdinosaur above I would paste into Notepad first and then into word / outlook - strips all the html and css out so you don't have to worry about the interpretation.
0
 

Author Comment

by:4ncid
ID: 38302442
Thanks again for responses. More details:

VB.Net runs the code-behind. We deliver this HTML result to the user's browser in response to a user's search.   They may just view it, or print it, or copy into email.  I have no control over what OS, browser, email client, etc. they are using.

But the current complaint is trying to copy and paste into an Outlook email message.  These are typical users and will not take kindly to muliple steps on their part to resolve.

If I change anything I would prefer that it makes more usable for many formats. Hope this helps.
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38302501
Ok from your answer I take it then that you do have control over how the page is generated? So part of solving the problem could be to adjust the way in which the page is rendered?

If that is the case - to solve the rendering issue need to see the actual markup for the page and the styles.

A view source on the page would do the trick.
0
 

Author Comment

by:4ncid
ID: 38304760
Yes Julian, I do have control of the page code and generation. There are two of my posts above that include the page source (case-search-source.txt) and the HTML results (case-search.htm).

Thanks again.
0
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 38304854
@4ncid - apologies - missed that post.

Content copies and pastes fine into both Word and Outlook 2003 - don't have access to 2010.

Have you tried setting the table width in the css section?

table {
  width: 580px;
  border: 3px solid black;
  border-spacing: 5px;
}

Open in new window

0
 

Author Comment

by:4ncid
ID: 38306296
No JulianH, have not tried that but I will. Thanks.
0
 

Author Comment

by:4ncid
ID: 38314579
Have not forgotten - just no time to test this yet....
0
 

Author Comment

by:4ncid
ID: 38343333
Well, none of these ideas worked! Tried setting the width for tables in the page style sheet, making a setting and appplying to a <div> - nada. Always spreads out in the email.

What DID work was adding a carriage return after each line was added as a datarow to the table in code-behind.

Thanks to everyone for your help.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question