Jump to content
  • 0

frD-Как сделать, чтоб таблица тянулась по высоте на 100 %


sc@r@bey
 Share

Question

сверстал шаблон для joomla сначало в html,

чтоб таблица тянуласть по высоте на 100% и не было отступов от границ броузера.

<html>
<head>
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="539" height="151"><img src="images/1.jpg" width="539" height="151" /></td>
<td width="241" height="151"><img src="images/4.jpg" width="241" height="151" /></td>
</tr>
<tr>
<td width="539" height="46"><img src="images/2.jpg" width="539" height="46" /></td>
<td width="241" height="46" align="center" background="images/menu.jpg"> </td>
</tr>
<tr>
<td width="539" height="77"><img src="images/3.jpg" width="539" height="77" /></td>
<td width="241" height="77" align="center" background="images/search.jpg"> </td>
</tr>
</table>
<table width="780" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="38" colspan="5" align="center" background="images/bar.jpg"> </td>
</tr>
<tr>
<td width="4" rowspan="2" background="images/contur.jpg"> </td>
<td valign="top"> </td>
<td width="2" valign="top" bgcolor="#dddddd"> </td>
<td width="150" valign="top" bgcolor="#fbfbfb"> </td>
<td width="4" rowspan="2" background="images/contur.jpg"> </td>
</tr>
<tr>
<td height="47" colspan="3" align="center" background="images/footer.jpg"> </td>
</tr>
</table>
<table width="780" height="4" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/kontur.jpg" width="780" height="4"></td>
</tr>
</table>
</body>
</html>

потом переделал в php b добавил css

* { 
margin: 0;
padding: 0;
}
body {
/*background:;*/
/*font:;*/
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 76.1%;
color: #0b0b0b;
/*background-color:;*/
/*background-image:;*/
/*background-repeat:;*/
/*background-position:;*/
}

<?php defined( '_VALID_MOS' ) or die( 'Доступ запрещен' ); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php $iso = split( '=', _ISO ); echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<link href="<?php echo $GLOBALS['mosConfig_live_site'];?>/templates/<?php
echo $GLOBALS['cur_template']; ?>/css/template_css.css" rel="stylesheet" type="text/css" />
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html;><?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<?php echo "<link rel="stylesheet" href="$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css" type="text/css"/>"; ?><?php echo "<link rel="shortcut icon" href="$GLOBALS[mosConfig_live_site]/images/favicon.ico" />"; ?>
</head>
<body>
<!-- Шапка -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="539" height="151"><img src="templates/<?php echo $cur_template; ?>/images/1.jpg" width="539" height="151" /></td>
<td width="241" height="151"><img src="templates/<?php echo $cur_template; ?>/images/4.jpg" width="241" height="151" /></td>
</tr>
<tr>
<td width="539" height="46"><img src="templates/<?php echo $cur_template; ?>/images/2.jpg" width="539" height="46" /></td>
<td width="241" height="46" align="center" background="templates/<?php echo $cur_template; ?>/images/menu.jpg"><?php mosLoadModules ( 'top' ); ?></td>
</tr>
<tr>
<td width="539" height="77"><img src="templates/<?php echo $cur_template; ?>/images/3.jpg" width="539" height="77" /></td>
<td width="241" height="77" align="center" background="templates/<?php echo $cur_template; ?>/images/search.jpg"><form action="index.php" method="post">
<div align="center">
<input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>" onblur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onfocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
<input type="hidden" name="option" value="search" />
</div>
</form>
</td>
</tr>
</table>
<!-- Тело -->
<table width="780" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="38" colspan="5" align="center" background="templates/<?php echo $cur_template; ?>/images/bar.jpg"><?php mosLoadModules ( 'user2' ); ?></td>
</tr>
<tr>
<td width="4" rowspan="2" background="templates/<?php echo $cur_template; ?>/images/contur.jpg"> </td>
<td valign="top"><?php mosMainBody(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></td>
<td width="2" valign="top" bgcolor="#dddddd"> </td>
<td width="150" valign="top" bgcolor="#fbfbfb"><?php mosLoadModules ( 'user1' ); ?></td>
<td width="4" rowspan="2" background="templates/<?php echo $cur_template; ?>/images/contur.jpg"> </td>
</tr>
<tr>
<td height="47" colspan="3" align="center" background="templates/<?php echo $cur_template; ?>/images/footer.jpg"><?php mosLoadModules ( 'bottom' ); ?></td>
</tr>
</table>
<!-- Футер -->
<table width="780" height="4" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="templates/<?php echo $cur_template; ?>/images/kontur.jpg" width="780" height="4"></td>
</tr>
</table>
<div align="center">
<?php include_once('includes/footer.php'); ?>
</div>
</body>
</html>

шаблон перестал выравниваться по центру,

поместил таблицу в

таблица выровнялась по центру, но появились отступы.

что исправить, чтоб было выравнивание по центру и не было отступов от окна броузера?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

<table width="780" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

>>>

<center>
<table width="780" cellpadding="0" cellspacing="0" cellpadding="0" style="height:100%; margin:0; padding:0; border:none;">

  <tr>
<td width="539" height="151"><img src="templates/<?php echo $cur_template; ?>/images/1.jpg" width="539" height="151" /></td>
<td width="241" height="151"><img src="templates/<?php echo $cur_template; ?>/images/4.jpg" width="241" height="151" /></td>
</tr>
<tr>
<td width="539" height="46"><img src="templates/<?php echo $cur_template; ?>/images/2.jpg" width="539" height="46" /></td>
<td width="241" height="46" align="center" background="templates/<?php echo $cur_template; ?>/images/menu.jpg"><?php mosLoadModules ( 'top' ); ?></td>
</tr>
<tr>
<td width="539" height="77"><img src="templates/<?php echo $cur_template; ?>/images/3.jpg" width="539" height="77" /></td>
<td width="241" height="77" align="center" background="templates/<?php echo $cur_template; ?>/images/search.jpg"><form action="index.php" method="post">
<div align="center">
<input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>" onblur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onfocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
<input type="hidden" name="option" value="search" />
</div>
</form>
</td>
</tr>
</table>

>>>

  <col width="539" />
<col width="241" />
<tbody>
<tr>
<td height="151"><img src="templates/<?php echo $cur_template; ?>/images/1.jpg" width="539" height="151" /></td>
<td height="151"><img src="templates/<?php echo $cur_template; ?>/images/4.jpg" width="241" height="151" /></td>
</tr>
<tr>
<td height="46"><img src="templates/<?php echo $cur_template; ?>/images/2.jpg" width="539" height="46" /></td>
<td height="46" align="center" background="templates/<?php echo $cur_template; ?>/images/menu.jpg"><?php mosLoadModules ( 'top' ); ?></td>
</tr>
<tr>
<td height="77"><img src="templates/<?php echo $cur_template; ?>/images/3.jpg" width="539" height="77" /></td>
<td height="77" align="center" background="templates/<?php echo $cur_template; ?>/images/search.jpg"><form action="index.php" method="post">
<div align="center">
<input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>" onblur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onfocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
<input type="hidden" name="option" value="search" />
</div>
</form>
</td>
</tr>
</tbody>
</table>
</center>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy