2

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.

3

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

Well, It worked on html for me Its your choice completely, the extension marketplace is full of options!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.