MySQL Table Subheaders
I think I've pretty much got the hang of creating MySQL tables. Now I'm just trying to refine my technique.
The table I'm working on features all the world's nations, in about 250 rows. For display purposes, I added the names of the continents in additional rows. For example:
It works fine, but when I sort a column, I'd prefer to isolate the subheaders (NORTH AMERICA, SOUTH AMERICA), so that they cluster at the top or the bottom, leaving a list of alphabetized nations only. Can this be done?
I also wondered if it's possible to make the subheaders span several columns, so that they can be centered in the middle of the table, rather than stuck in the first or second column. However, I presume that can't be done without disrupting the sort function.
you will need to separate the following concepts: structure and style
you data is structured like this:
NORTH AMERICA Canada
NORTH AMERICA United States
NORTH AMERICA Mexico
SOUTH AMERICA Brazil
SOUTH AMERICA Venezuela
you might not have stored the continent names redundantly like that, but that's not the point, because that is exactly what you get as a result of a join query
do not attempt to style the output using sql to look like this:
. United States
that is best done in a programming language