html/php page design
i created several self-contained pages containing a 3 X 3 table where the top row is header, middle row middle column is the body, and the botton row is footer. the problem was the bodies of the pages differed in width so the header would shift with them.
instead of re-writing the header and footer and making its style dependent on the body, i
- put header and footer in tables separated from the body.
- created independent files for both such as: "header.php"
contents of "header.php" (though indentation is not shown not opening brackets since this site wants to execute the php included):
table border="0" cellpadding="0" cellspacing="2" width="720">
tr>
td>
div align="center">
h5>THE HEADER OF YOUR PAGE
/h5>
/div>
/td>
/tr>
/table
this file can then be included in the file containing the html content of the body as (again with opening bracket omitted):
?php
@include 'header.php';
?>
this saves lots of time worrying with the formatting of the header since it only has to be modified in one place (not on every separate page).
instead of re-writing the header and footer and making its style dependent on the body, i
- put header and footer in tables separated from the body.
- created independent files for both such as: "header.php"
contents of "header.php" (though indentation is not shown not opening brackets since this site wants to execute the php included):
table border="0" cellpadding="0" cellspacing="2" width="720">
tr>
td>
div align="center">
h5>THE HEADER OF YOUR PAGE
/h5>
/div>
/td>
/tr>
/table
this file can then be included in the file containing the html content of the body as (again with opening bracket omitted):
?php
@include 'header.php';
?>
this saves lots of time worrying with the formatting of the header since it only has to be modified in one place (not on every separate page).
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home