Like editing code, viewing files can also be done in Cpanel and you are not required to download it to your local computer first. The difference is, the View menu on the toolbar only functions to view the contents of the file, you cannot edit the contents of the file through this view menu.
To view a file, click the file you want to view and then click the View button on the toolbar, or you can also right-click the file and select the View menu. Then a new window will appear to display the contents of the file.
In principle, the View tool is the same as the Edit Files tool, but this view tool is specifically for viewing the contents of script files such as .html, .css, .js, .php, etc.