Using CSS styles with SQL HTML output


The above example is all that is necessary to actually create a usable HTML document. However, except for the style attributes of the <TABLE> tag (such as "width" and "border"), the format of the table will be vanilla HTML defaults. The user may wish to modify this to make the output report more conformal to other screens.

The look of the HTML table, containing the SQL results, is easily modified via CSS styles. The programmer merely references the "class" attributes of the table, which are automatically added to the HTML output. This permits users to modify table colors, column widths, and other characteristics of the display output. The class names for the HTML elements are readily available by inspecting the HTML source.

Note that this will entail modifying the styles.css file, since the HTML <HEAD> tag is contained in the s-header.html file, and cannot be overridden by the HTML document described here. Since the class names for the various HTML elements are very unique, there should be no issue with adding extra styles for the various SQL HTML output tables, simply by appending the styles to the styles.css file of the system.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*