jrdnoland
jrdnoland

Reputation: 3

Why do I keep getting an extra line in my text?

I'm writing an access piece of code that "walks" a user through a specific process. The code in basic HTML code that shows up as regular text in an Access Textbox control.

My text needs to look like:

<div>Steps Taken:</div>
<div>&nbsp;</div>
<div>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Batchfile or email has been used to open this project.</div>
<div>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select/Deselect the necessary Folder checkbox.</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Complete One at a time.)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2a.&nbsp;&nbsp;&nbsp;&nbsp; Analytical Lab Selected</div>
<div>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust optTextTypes as necessary or click "Skip This Step".</div>
<div>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust Project Status as Necessary (Most New Requests</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; will have a Project Status of "In Progress".)</div>
<div>5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust Project Status Notes for this Release then click</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("Skip This Step".)</div>
<div>6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff0000;">Add, ignore, or change LIMS Parent Project Number</span></div>
<div><span style="color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and then click ("Skip This Step".)</span></div>

But, it continues to look like:

<div><font color=black>Steps Taken:</font></div>

<div>&nbsp;</div>

<div><font color=black>1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Batchfile or email has been used to open this project.</font></div>

<div><font color=black>2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select/Deselect the necessary Folder checkbox. </font></div>

<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Complete One at a time.)</font></div>

<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2a. &nbsp;Analytical Lab Selected</font></div>

<div><font color=black>3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust optTextTypes as necessary or click &quot;Skip This Step&quot;.</font></div>

<div><font color=black>4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust Project Status as Necessary (Most New Requests</font></div>

<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will have a Project Status of &quot;In Progress&quot;.)</font></div>

<div><font color=black>5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust Project Status Notes for this Release then click</font></div>

<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&quot;Skip This Step&quot;.)</font></div>

<div><font color=black>6. &nbsp;&nbsp;</font></div>

<div><font color=red>Add, ignore or change LIMS Parent Project Number</font></div>

<div><font color=red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and then click (&quot;Skip This Step&quot;.)</font></div>

I can't get it to show the issue here, but basically, after the #6 is displayed the sentence jumps a complete line. I've pasted the code into other HTML online versions and it shows the line skip. I get it working on the online version, copy the HTML and paste it back into my access app, but the line skip happens again.

Not sure what I should be looking at to get it to work?

Upvotes: 0

Views: 57

Answers (1)

abhinav3414
abhinav3414

Reputation: 967

This happens because div is a html block element. Which means when you use it, each new div starts in new line.
So your point 6 and text next to it moves in different lines because of 2 divs. I would suggest to use a span for your text since its not a block element.
Below is the code which you can use for your point 6:

<div><font color=black>6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <span style="color:red"> Add, ignore or change LIMS Parent Project Number </span>
</font></div>

Also, to make your job easier I would suggest to use ordered list of HTML.
Below is the plnkr example I have created for you. It has ordered list with minimal styling. https://plnkr.co/edit/fjA60WtwsL9IhzSK?open=lib%2Fscript.js&preview

Upvotes: 1

Related Questions