Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Formatting an HTML Email

Posted on 2011-09-17
7
Medium Priority
?
278 Views
Last Modified: 2012-08-13
Hi - I need to generate an HTML email which has a table of data embedded in it - the table has multiple rows and columns each of them with data of varying lengths - since this email is generated as HTML I am using whitespaces to separate the data in each row  

However the email that is generated does not look uniform and has data in a rows looking jumbled up - I found there is no exact formula so a whitespace entry does'nt necessarily translate to a whitespace in HTML.

Has anyone tried doing this and is there a way of generating a uniform HTML ?

Thanks
0
Comment
Question by:abuyusuf35
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36554547
Are you separating the cell in HTML table with <td>stuff</td>?

I put &nbsp; only in those cells which have to be empty between the <td> and </td> tags - otherwise I just put required text between the td tags no matter how different in length it is
- if you have the same nimber of cells in each
row (rwos separated by </tr><tr>) I get uniform tables
0
 

Author Comment

by:abuyusuf35
ID: 36554557
How about elements within a row ? How can I space them out evenly ? Given that they are different lengths ? Thanks
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36554564
I don't do anything special - once you have the same number of cells it will adjust each cell to the row which have this cell longest - you'll have of course columns of different type
0
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.

 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 36554565
First try without any emails - just put your HTML to a file.html and open it with IE or Firefox - these things are the same -
your email will still be eventually formatted by the browser

Are you sending email from java with javamail ?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36554567
You would have to give each <td> a width like <td width='50px'>.  Also, in HTML, if you have more than one space ' ', only the first one is displayed.  If you want additional blank spaces, you have to use "&nbsp;" which is the code for 'non-breaking space'.

http://www.sitepoint.com/code-html-email-newsletters/
0
 

Author Comment

by:abuyusuf35
ID: 36554578
I tried using &nbsp;but is it not giving me an even row of elements I will try <td width='50px'> that might work
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36554591
Yes, if you put nothing the cells will be adjusted to the widest across the rows - if your data is of the same length you can put the width everywhere

you can also look here with lots of discussions on how to adjust the width of cells in HTML tables:
http://stackoverflow.com/questions/1057574/html-td-wrap-text
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

636 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