How can I implement display inline (html/css) in VBA? - html

I am using VBA to generate an Outlook email. I want to put the email address with a gray background color and I want it to be in front of "Resource (s):".
This is my VBA code:
bodyHTML = bodyHTML + "<p style=""display: inline"">Resource(s): #" & "<p style=""display: inline; background-color: #EDEDE7; font-size: 15px; font-weight: normal"">" & aloc.resourceEmail & "</p></p>"
This is the result. Over the dotted line: the way it is. Below the dotted: The way it should be

<p> is a paragraph, it adds a newline.
Replace <p> with <span> which does not add a newline (and consequently replace </p> with </span>

Related

How to set text-wrap class in Chrome

I want use below code to enable line break for the cell.
Grid6Obj.getRowTemplate().setClass("text", "wrap");
But when I opened the page in chrome and it didn't work.
I debug the page and the html is like below.
<span id="aw36-row-0" class="aw-templates-list aw-text-wrap aw-grid-row aw-row-0 aw-rows-normal aw-alternate-even "><span id="aw36-row-0-start" class="aw-row-start " style="width:0px;"></span><span id="aw36-cell-0-0" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal " style="border-right:1px solid #ccc;border-bottom:1px solid #ccc;" title="">123 456 678</span><span id="aw36-cell-1-0" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal " style="border-right:1px solid #ccc;border-bottom:1px solid #ccc;" title="">12</span><span id="aw36-row-0-end" class="aw-item-template aw-grid-cell aw-column-space "><span id="aw36-row-0-end-box" class="aw-item-box "></span></span></span>
It set the class but the value "123 456 678" is still in one line. Is this because Chrome didn't suppose this class?Then what's the correct way to archieve it? Thx.
I did some research for you, there are 3 easy options. wrap your data in PRE tags
<PRE>
123
456
678
</PRE>
or in your aw.css file you could change the css on line 17
.aw-text-normal .aw-templates-cell, .aw-text-normal .aw-templates-text, .aw-text-normal .aw-templates-link, .aw-text-normal .aw-item-box {
white-space:nowrap;
}
Which is set to nowrap, changing this to pre will allow you to hard break your lines. Though this solution will change all cells to type PRE
.aw-item-box {
white-space:pre
}
Alternatively you could mutate your data to this:
"Line1 \r\n Line 2"

xpath text within a span within text within a div

I'm trying desperately to extract text from within a span which is within text which is within a div (underlined in the image)
This is the relevant part of the code ...
<div id="groupBlock3">
<div class="groupBlockTitle">
::before
"
ALL TEACHERES ("
<span class="activeTeachers">12</span>
" ACTIVE, "
<span class="archivedTeachers">1</span>
" ARCHIVED)
"
<div>...</div>
<div>+ enroll a teacher</div>
</div>
<div>...</div>
</div>
I can retrieve the text from within the first div with this ...
"normalize-space(//div[#id='groupBlock3']/div[1])"
... which gives me ...
'ALL TEACHERES ( ACTIVE, ARCHIVED) + enroll a teacher'
... but, try as I might I cannot get the text from within the first or second span - it just returns a null string. Please help me!!
Try one of these XPath-1.0 expressions:
normalize-space(//div[#id='groupBlock3']/div[1]/span[1]/text())
which results in 12, or, for the second span
normalize-space(//div[#id='groupBlock3']/div[1]/span[2]/text())
which results in 1.
But if you want all text of the first div, use this expression
normalize-space(string(//div[#id='groupBlock3']/div[1]))
which gives you the result
::before " ALL TEACHERES (" 12 " ACTIVE, " 1 " ARCHIVED) " ...+ enroll a teacher

Display label and <a> same line inside a table

"<td style=max-width:0px;>" +
"<span> Issuer: <a href=/app?"+JSON.stringify(issuer)+" target='_blank'> <span> " + celldata[rowIndex].hiddenprops.issuer +" </span></a> </span>"+
"</td>"
The result should be: "issuer: rojioijoijrieroirjg"
but I get
: "issuer:
rojioioijoij"
on two different lines. I tried display:inline on every tag and tried to insert tags and stuff but nothing is working?
Any idea how I should proceed. All I want is a label on the same line than my link inside a <td>

Hover text is broken if text has special symbols when description is given

Example:
<a title="A web design community.'test'~`!##$%^&*()-_+=\|][{};:,<.>?/ **"new test"** " href="http://css-tricks.com">CSS-Tricks</a>
In tooltip, after the double quotes "new test" is not working.
Is there any possible to show the content in tooltip like this
ex: testing 'welcome', # 3 $ ^ & * "flow"?
The problem is that your double quotes in the title close your title automatically. Escape them by replacing " with " and also funkwurm recommends to replace < and > with < and > respectively to avoid errors in xml:
<a title="A web design community.'test'~`!##$%^&*()-_+=\|][{};:,<.>?/ **"new test"** " href="http://css-tricks.com">CSS-Tricks</a>
You can use this is also.
<a title="Answer to your's question.'Test It' :):)'B Happy' :):)"new test"**" href="http://css-tricks.com">CSS-Tricks</a>

How we can bold only the name in table td tag not the value

Is there any way that I can make CC Quid, Application Number, Application Title and in the same way other thing in bold, I don't want their value to be in bold. Any suggestions will be appreciated..
html = html + "<table border ='0'>";
html= html + "<tr>";
html =html + "<td>CC Quid: " +(data.response.docs[0].c_cc_guid)+"</td></tr>";
html =html + "<tr><td>Application Number: " +(data.response.docs[0].c_application_number)+"</td></tr>";
html =html + "<tr><td>Application Title: " +(data.response.docs[0].c_application_title)+"</td></tr>";
html =html + "<tr><td>Application Type Name: " +(data.response.docs[0].c_application_type_name)+"</td></tr>";
html =html + "<tr><td>Case Mgr Name: " +(data.response.docs[0].c_case_mgr_name)+"</td></tr>";
html =html + "<tr><td>Filed Date: " +(data.response.docs[0].c_filed_date)+"</td></tr>";
html =html + "<tr><td>Lead Atny Name: " +(data.response.docs[0].c_lead_atny_name)+"</td></tr>";
html =html + "</table>";
Surround what you want to be bold with:
<span style="font-weight:bold">Your bold text</span>
This would go inside your <td> tag.
Wrap the name in a span, give it a class and assign a style to that class:
<td><span class="names">Name text you want bold</span> rest of your text</td>
style:
.names { font-weight: bold; }
I might be misunderstanding your question, so apologies if I am.
If you're looking for the words "Quid", "Application Number", etc. to be bold, just wrap them in <strong> tags:
<strong>Quid</strong>: ...
Hope that helps!
you can try this
td.setAttribute("style", "font-weight:bold");
Try this
.Bold { font-weight: bold; }
<span> normal text</span> <br>
<span class="Bold"> bold text</span> <br>
<span> normal text</span> <spanspan>
I would use to table header tag below for a text in a table to make it standout from the rest of the table content.
<table>
<tr>
<th>Dimension:</th>
<td>98cm x 71cm</td>
</tr>
</table