Datagrid for PHP & MySQLSynopsisThis is a datagrid class which can show the MySQL result set which you pass to it as a paged list. It can be completely styled using CSS (which looking at the examples, I'm sure you'll be grateful for). A quick example:
This will show a bare bones list of users and the corresponding hosts they can connect from. You will probably want to customise this quite a bit (appearance wise), which you can do with CSS, and with the various methods available to you (eg. SetDisplayNames()). Features:
ExamplesBelow is an IFRAME showing one of the example scripts which you can get from the download area. Bear in mind that the example scripts look more complicated than would be typical as they show off everything (or try to) and the HTML and CSS are in the same file as the PHP magic. Example 1 :: Example 2 :: Example 3 :: Example 4 :: Example 5 :: Example 6 :: Example 7 :: Example 8 CustomisationYou can customise the "look and feel" using CSS. The grid uses a single table, which has the class datagrid. The headers are inside a <thead> tag, and the paging correspondingly in a <tfoot> tag. Using CSS you can then create corresponding CSS rules for them: .datagrid thead th {
Naturally the body of the table uses a <tbody> along with <td> cells. StructureThe tag structure of the datagrid is explained by this picture. Consider it "nice" structure, as it should be. The table has a class attribute of datagrid, the headers are in <th> cells, which themselves are in a <thead> tag. The body rows are in <td> cells, and a <tbody> tag. And the footer is in a <tfoot> tag. Doing it this way allows finer grained control over the style. eg: .datagrid thead th is the CSS selector that you would use to change the style of the headers. Development versionIf you really want, you can look at the development version here. This is by no means gauranteed to work though.DownloadFrom the download area. |
