I am taking an HTML / Web Design course and just started it the other week. Now this isn't the first time I've done HTML, but I don't really remember much of it. I am trying to put some Java Code onto one of my web pages, as a way of "showing my recent accomplishments".
So what I'm looking for is a way to format a block of text, so that it retains all its white space / tabs.
<BODY>
<h1> Java Code Samples! </h1>
<P> Hello, and welcome to the java code sample section of my site. Here I will put some </P>
<P> random samples of code that I have written and projects that I have completed </P>
<br />
<h3 align="left"> These are some random methods: </h3>
<p>
<i> //Returns index of item in other array
//Efficiency ( O(N) )
public static int getOtherIndex(String searchString, College[] searchTarget)
{
for(int i = 0; i < searchTarget.length; i++)
if(searchString.trim().equalsIgnoreCase(searchTarget[i].nameOfSchool.trim()))
return i;
return -1;
}
</i>
</p>
</BODY>
I am trying to format the method in a way that retains the initial white space, but while using the italics tag to make it stand out.
Any help would be appreciated.