Hi @Anonymous ,
This is not possible to achieve this by list formatting. It only changes how it’s displayed to users who browse the list. We can only change the columns or views formatting. You can refer to the document for more details
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#style-guidelines
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.