How to align data in the output

Is there a way to align data that comes from the variable (# of visits) that looks like this…

On this date 2022-08-01 we had 12 visits 
On this date 2022-08-02 we had 123 visits 
On this date 2022-08-03 we had 101 visits 
On this date 2022-08-04 we had 18 visits 
On this date 2022-08-05 we had 220 visits 

so that it looks like this

On this date 2022-08-01 we had  12 visits 
On this date 2022-08-02 we had 123 visits 
On this date 2022-08-03 we had 101 visits 
On this date 2022-08-04 we had  18 visits 
On this date 2022-08-05 we had 220 visits 
1 Like

What do you mean with output? Console output or in an HTML Page?

in HTML page

I was able to find this in JS docs. It solved my problem.

padStart

This code will help you in HTML for data alignment.

<!DOCTYPE html>

<html>

<head>

     <title>

         HTML p align Attribute

     </title>

</head>

<body>

     <h1>Project</h1>

     <h2>HTML p align Attribute</h2>

     <p align = "left">

     Left align content

</p>

      <p align = "center">

     center align content

</p>

      <p align = "right">

     Right align content

</p>

</body>

Thank you. Please correct me if I missed something.

@julia150612 the align attribute has long been removed from HTML. You should be using CSS to align items.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.