I believe that you would have to add an HTML block for this. I sure don’t see any other way to do this. Doubt very much anyone will ever create a block for this.
Gutenberg creates code blocks in a pre-defined format, with few variations allowed. This seems to be one of the restrictions in using Gutenberg as a code generator. Oftentimes, these restrictions do not allow you to create the HTML code that you might want to. This may not be a problem for post or page creators who create them visually but sure present problems when you know how to use HTML and CSS to create post and page content.
classic editor and gutenberg are post/page content builder tools that work in completely different ways than the other one, building posts/pages like you do with the classic editor remains a major challenge with gutenberg. gutenberg uses blocks, and a lot of blocks you may want to use are just not available.
Al
ps look at the experiences of Automattic employees using gutenberg at “automattic.design”, earlier this year, they were asked to clone a web page from a site like longreads.com using gutenberg. many things done cannot be duplicated in gutenberg, using the blocks currently available, unless you use the HTML block.