Is there a way I could display the table towards right hand side of the screen and have the table position top part start next to Show Cases button? Something like this (image edited using paint just to give an idea)?
You should not need all those <div> elements, as demonstrated here:
As there is no row below Show Cases in your JSFiddle, it is not possible to say why your extra row is starting from the bottom of the table. If you use your browser’s developer tools to examine the HTML, is the HTML for the extra row after the HTML for the table (which is not an HTML <table>)?
Your JavaScript is inserting the ‘table’ into the <div> element which has id="jqxgrid". Your HTML for the second row currently comes after that.
I have considered keeping all the “controls” (including Show Cases button) together in one Flexbox container so they wrap as necessary: not constrained to two rows regardless of browser width. In the CodePen below, I have introduced an outer Flexbox container to include the "Information" panel. This too has flex-direction: row by default. I was hoping to arrange that the controls wrap within their Flexbox container before the information panel wraps below the controls, but this does not happen. From this on StackOverflow, there does not seem to be a satisfactory solution, although I think @media could be used but that would be starting to bodge things. I note that your "Information" panel, which looks like a table, is not responsive.
Thanks Paul. Yes, that wraps better but on a wide browser window a wide gap can appear between the Show Cases button and the "Information" panel. A value of max-width on the controls element could sort that out.