I have a query here. I am sending an HTML table(which I am creating it by a call to REST API, in a LINUX box) and from there I have to send it into an email. So following are the poins on same:
As data is not static so it is writing Dynamic data and creating HTML file.
There is a table which has many fields into it in that HTML file.
I am sending this HTML table into an email by shell script(command sendmail ).
All field's value could be of any length.
So above are some information points on this, following is the question now on same.
Query:
As I mentioned above field's length could be any. So when I am sending that email with HTML table, so it's one field has more length compare of any other field, so because of it all other fields(including columns and data) are shrinking into size and it is looking very odd in email. Basically I require all the fields to be same width and all values should come in single line into email, off course there could be a limit for wordwrap but field's data should go till that but that's not happening.
Following are the things I had tried too in order to fix it(which didn't work):
Tried to fix table's width.
Used {"white-space: nowrap"} .
Tried above but it didn't work, I can't paste data here apologies for it but I have tried my best to explain the issue, please do let me know if any further information required here too. Could anyone please help in same, will be grateful.
Thanks Yoda for your reply, yes it is a css property but we could use it either with head and style tags or we could use it in td tag. I tried both but nothing worked. Sorry can't paste samples but it is very easy to predict like the last field/any filed is having long length data so all other fields are shrinking, which I don't want to be. Could you/form please guide me in same.
Not sure if above gives clear picture of question or not. As we could see some column's data are not coming into a single line. So I wanted to have them in a single line. So in order to fix this in email(outlook client) I have increased the length of the problematic columns let's say column 6th I have changed from test_test_test to test_singh_test_singh_test so it has increased the width of the whole column in table. I had tried seveal options in it but it didn't work so in order to fix it I have done this non-technical fix. If anyone has any fix for this, it is always welcome.
Apologies for not being clear as I have copy and pasted HTML table in code tags but it was not shown as a table, finally ended up with writing a small awk to shown up following.
So as you could see 3rd column whose value is TEST_2_AGAIN_TEST was previously not coming on same line, in a single row. So I have done 2 things.
i- Have changed the largest column(last column here) values(because of which other columns were getting shrink) I have put it's values separated by space so in html it not increase it's(column's) width it will print then as follows to it.
_____________________________________________________________________________________________
|TEST | TEST_1 | TEST_2_ AGAIN_TEST | TEST_3 | TEST_4 | TEST|
| | | | | | 5 |
| | | | | |TEST |
.
.
.
so on to all values.
_____________________________________________________________________________________________
ii- Second thing I have done it I had increased the heading(means summary of shrink 3rd column) so by doing these 2 steps it is not shrinking the columns now.