'Why CSS?' episode 412: 'Doing more with less'. Less code, less HTML output, but more flexibility in the layout. Seperating content from design, yay :-)

svn path=/web/trunk/; revision=1482
This commit is contained in:
Max Horn
2003-10-13 17:37:32 +00:00
parent cf1b7429cc
commit d75fdae16a
3 changed files with 60 additions and 44 deletions
+6 -25
View File
@@ -10,44 +10,25 @@ class htmlmenu {
function htmlmenu($name)
{
global $file_root;
echo "<table width=120 border=0 cellspacing=0 cellpadding=0>\n";
echo "<tr>\n";
echo " <td class=topMenu><span class=menuTitle>&nbsp;$name</span></td>\n";
echo " <td align=right valign=top class=topMenu><img src='".$file_root."/images/main_right_top.gif' alt='---'></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<table width=120 border=0 cellspacing=0 cellpadding=2>\n";
echo "<tr>\n";
echo " <td class=sideMenu><img src='".$file_root."/images/blank.gif' height=5 width=1 alt='---'></td>\n";
echo "</tr>\n";
echo "<div class='sideMenu'>";
echo "<div class='header'><div class='headerRight'>".$name."</div></div>";
}
/* add a table row */
function add($name, $url = null)
{
echo "<tr><td class=sideMenu><span class=menuItem>&nbsp;";
echo '<div class="item">';
if($url) {
echo "<a href='$url' class=menuItem>$name</a>";
echo "<a href='$url'>$name</a>";
} else {
echo "$name";
}
echo "</span></td></tr>\n";
echo "</div>\n";
}
function done($extra = "")
{
global $file_root;
echo "</table>\n";
echo "<table width=120 border=0 cellspacing=0 cellpadding=0>\n";
echo "<tr>\n";
echo " <td align=right class=sideMenu><img src='".$file_root."/images/main_right_bottom.gif' alt='---'></td>\n";
echo "</tr>\n";
echo "</table>";
echo $extra;
echo "<br>\n";
echo "<div class='footer'><div class='footerRight'>&nbsp;</div></div></div><br>\n";
}
}
?>