There are several possible answers, depending on what you mean by "next to".
<p id="csvData"></p>
<p id="csvData2"></p>
If paragraph length isn't an issue, the first question might really be "Why do you need <p>
tags?" Understanding the difference between block tags and inline tags is foundational in HTML. I mention this because you indicate you are new to HTML. You may find what you need simply by using <span>
or some other tag. See the Mozilla Developer Network documentation for explanations of block and inline elements.
Using a different element, such as <span>
is preferable in the long run to modifying <p>
tags from the block type, in my opinion.
<!-- Alternative, with spans instead -->
<span id="csvData"></span>
<span id="csvData2"></span>
Or, if you must, you can use CSS
#csvData, #csvData2 {
display: inline; /* or, inline-block */
}
@Moose provided a good link in a different answer to a question explaining the difference between block, inline, and inline-block. Worth reading.
If you want the paragraphs in a two-column layout, that question has many solutions here on StackOverflow. e.g., here, here and here.
Another possible solution is floats. Floats are applied via CSS, and cause elements to stack left (or right, depending on the declaration) with minimum widths. There are several complications with floats. Float changes the default width of elements, and may cause other complications related to object height/width. (For example, an otherwise unstyled paragraph takes as much width as it can naturally, but a floated paragraph has a smaller width.) Usually when you use floats, you'll want to manually specify a width, and will need to "clear" the floats later. There are many good resources on floats here, including here and here.
/* CSS */
#csvData, #csvData2 {
border: 1px dotted blue; /* To show the paragraphs */
float: left;
width: 100px;
}
` tag instead. Alternatively, by default `