nowox
nowox

Reputation: 29178

How to format HTML in VSCODE

I have read many similar questions on SO, but none answer my problem.

I have a .php file with this content:

<?php something(); ?>

<div class="container">
                         <div class="row">
                             <div class="col">
Hello World!
</div>                             
            </div>
</div>

And I would like to reformat either the php or the html code, either globally or the selection.

I have tried all the Format document option, but it does not work.

Ctrl+Shift+p, Format document

If I change the extension for .html, then it works.

Upvotes: 2

Views: 9512

Answers (1)

Krishanu
Krishanu

Reputation: 560

There are many extensions in the marketplace of VSCODE for formatting the code. Try one of them. I might even recommend Prettier ext. Try others as well you might one usefull

Upvotes: 3

Related Questions