hi i am using Frontpage on XP and would like to ask how i resize my webpage so that it is in the middle of the page when people view it: plz visit [URL=http://www.freewebtown.com/footballmanagercentral]FMC[/URL] You can see if you continue to football manager central by clicking on the writting that my web page is basically orientated to the left. i would like to centre the page but i am unsure how to. I am using shared borders as well. So how do i centre my page when it is view thanks very much livin_dragon
@livin_dragonauthorJan 25.2005 — #ive got the writing in the middle to resize however the shared borders wont does anyone know how to get the borders to recentre
@phpnoviceJan 25.2005 — #MS Shared Borders are not intended to be positioned anywhere except -- at the borders. That is why they are called that. To do otherwise would require turning off Shared Borders on that page and using server-side code to dynamically extract the Shared Border content and insert it into the page as desired. I have written PHP code that does something very similar to this -- except that it mimics the same positioning that Shared Borders uses. If you want my code, you could easily modify it to build auto-centering "borders".
@phpnoviceJan 26.2005 — #What this does is to extract the content between the opening and closing BODY tags of the MS Shared Border documents in the _borders folder. Then, the same TABLE elements that MS uses are wrapped with the extracted content. Thus, you can change the kind of tags and attributes that are used for these wrappers. Good luck.
[code=php]<?php function GetSharedBorder($b, $opt = 'BEG') { // get border content if ($b !== 'right' and $opt == 'BEG' or $b == 'right' and $opt == 'END') { $f = "{$_SERVER["DOCUMENT_ROOT"]}/_borders/{$b}.php"; $s = @fopen($f, 'r'); if ($s == false) { $content = '<p>open_error</p>'; } else { $content = @fread($s, filesize($f)); @fclose($s); $s = preg_match('/<body[^>]*>(.*)</body>/is', $content, $matches); if ($s == false) { $content = '<p>not_found</p>'; } else { $content = $matches[1]; } } } else { $content = '<p> </p>'; } // add wrappers to the border content switch (true) { case ($b == 'top'): $border = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; $border .= '<!--begin_top_border--><td style="padding:0;">'; $border .= $content; $border .= '</td><!--end_top_border--></tr></table>nn'; break; case ($b == 'left'): if ($opt == 'BEG') { $border = '<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; $border .= '<!--begin_left_border--><td valign="top" width="1%" style="padding:0;">'; $border .= $content; $border .= '</td><!--end_left_border--><td valign="top" width="24" style="padding:0;"></td>'; $border .= '<!--begin_main_area--><td valign="top" style="padding:0;">n'; } else { $border = '</td><!--end_main_area--></tr></table>nn'; } break; case ($b == 'right'): if ($opt == 'BEG') { $border = '<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; $border .= '<!--begin_main_area--><td valign="top" style="padding:0;">n'; } else { $border = '</td><!--end_main_area--><td valign="top" width="24" style="padding:0;"></td>'; $border .= '<!--begin_right_border--><td valign="top" width="1%" style="padding:0;">'; $border .= $content; $border .= '</td><!--end_right_border--></tr></table>nn'; } break; case ($b == 'bottom'): $border = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; $border .= '<!--begin_bottom_border--><td style="padding:0;">'; $border .= $content; $border .= '</td><!--end_bottom_border--></tr></table>nn'; break; default: $border = "{$content}n"; } // return the completed content return $border; } ?>[/code] The following is an example of how the above is used to create a top, left, and bottom shared border. <i> </i><body>
@livin_dragonauthorJan 26.2005 — #sorry to bug you again but i dont know how to paste the code above into my frontpage html i only need the top and left border so could you please help me thankyou very much
@phpnoviceJan 26.2005 — #Basically, you cut-n-paste it into Notepad first. Then, from Notepad, you cut-n-paste it into the HTML view of FrontPage. Going through Notepad strips out the formatting and creates plain text.