• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Formatting an HTML Email

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
abuyusuf35
Asked:
abuyusuf35
  • 4
  • 2
1 Solution
 
for_yanCommented:
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
 
abuyusuf35Author Commented:
How about elements within a row ? How can I space them out evenly ? Given that they are different lengths ? Thanks
0
 
for_yanCommented:
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.

 
for_yanCommented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
abuyusuf35Author Commented:
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
 
for_yanCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now