Hi, not sure why you consider this a hack. It’s actually the proper way to center a block element – i.e. constraining its (max-)width and setting the left/right margin to auto
.
If you are too worried about some of your items wrapping at lower viewport widths, you could consider the following solution:
https://www.smartmenus.org/about/themes/#demos-7
but I personally don’t think that is a critical issue since all items remain usable even if some of them are wrapped.