Avatar of Jeffrey Renfroe
Jeffrey Renfroe
Flag for United States of America asked on

Center iframe in html code

Hello. I have completed work on the modification of an hta. When I run the hta everything looks except that the iframe is off center. I have tried modifying the code but cannot get the results I am looking for. I trying to center the iframe within the whitespace.

I have supplied my code below. I would appreciate any assistance.
<!--Script Settings
<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd">
  <ScriptPackager>
    <process />
    <arguments />
    <extractdir>%TEMP%</extractdir>
    <files />
    <usedefaulticon>true</usedefaulticon>
    <showinsystray>false</showinsystray>
    <altcreds>false</altcreds>
    <efs>true</efs>
    <ntfs>true</ntfs>
    <local>false</local>
    <abortonfail>true</abortonfail>
    <product />
    <version>1.0.0.1</version>
    <versionstring />
    <comments />
    <includeinterpreter>false</includeinterpreter>
    <forcecomregistration>false</forcecomregistration>
    <consolemode>false</consolemode>
    <EnableChangelog>false</EnableChangelog>
    <AutoBackup>false</AutoBackup>
    <snapinforce>false</snapinforce>
    <snapinshowprogress>false</snapinshowprogress>
    <snapinautoadd>0</snapinautoadd>
    <snapinpermanentpath />
  </ScriptPackager>
</ScriptSettings>
endregion-->
 
<html>
<body class='Normal' scroll="No" onload='StartHta()'>
    <title>FTC Tool </title>
    <hta:application id="Demo Count Down" applicationname="Demo Count Down" border="none"
        caption="no" showintaskbar="Yes" singleinstance="Yes" sysmenu="No" windowstate="normal"
        version="1.0.0" innerborder="yes" selection="yes" maximizebutton="No" minimizebutton="no"
        navigable="yes" contextmenu="yes" borderstyle="normal" icon="%SystemRoot%\Explorer.exe">
 
<STYLE type="text/css">  
    Body.Normal
    { 
      font: 11pt Ariel;
      color:black;
      filter:progid:DXImageTransform.Microsoft.Gradient
      (GradientType=0,StartColorStr='#86cceb',endColorStr='#5589ab');
      padding-top:1;
      padding-bottom:1;
      Text-Align:Center;
    }
    Table.Normal
    { 
      font: 11pt Ariel;
      color:black;
      filter:progid:DXImageTransform.Microsoft.Gradient
      (GradientType=0,StartColorStr='#86cceb',endColorStr='#5589ab');
      padding-top:1;
      padding-bottom:1;
      Text-Align:Center;
    }
    .Link1
    { font-family:Palatino Linotype;
      color:;
      line-height:110%;
      text-align:Center; font-style:normal; font-variant:normal; font-weight:normal; font-size:8.75pt
    }
  .style1 {
	margin-right: 0px;
    }   
   TD.button { padding-top: 15px; }
</STYLE>
<table Class='Normal' border="0" id="table1" bgcolor="#99CCFF" style="width: 62%">
	<tr>
		<td style="width: 27%" rowspan=2>
            <p align="center"><img border="0" src="images/image1.GIF" width="167" 
                    height="63"></td>
		<td colspan="3">
		    <p style="text-align: left; width: 362px;" class="style1">
		    <b><font face="Tahoma" size="5" color="#FFFFFF">FTC Tool</font></b>
		</td>
	</tr>
	<tr>
		<td style="width: 23%">
		    <td align="center" style="width: 18%">
		    <font face="Tahoma" size="2"><b style="text-align: left"><SPAN ID='Text2'></b> </SPAN> </font>
		</td>
	</tr>
	<tr>
		<td xwidth="10%" style="height: 257px; width: 27%;">
            <b><font face="Tahoma" size="2">Start or Cancel Optimization?</font></b>
            <form name="Oneform" method="post">
                <table id="xp-web-buttons.com:idalyf3" width=0 cellpadding=0 cellspacing=0 border=0>
              <INPUT TYPE="button" name="Start" value="Start" STYLE="color: #0000FF" STYLE="{font-size: 150%}" onClick="parent.location='vbscript:InstallNow()'">
              </td>
              </div>
              <br/>
              <INPUT TYPE="button" name="Cancel" value="Cancel" STYLE="color: #FF0000" STYLE="{font-size: 150%}" onClick="parent.location='vbscript:Cancel()'">
              </td>                
              </table>
            </form>
        <SCRIPT type="text/javascript" language="JavaScript1.1">
        <!--
         //-->
        </SCRIPT>
        <SCRIPT language="VBScript">
 
        '/--------------------------------------------------------------------------------------> 
        '/-> POSTPONE THE HTA 
            Function Cancel()
            window.close()
            End Function
        '/--------------------------------------------------------------------------------------> 
        '/-> Checks the registry key and runs the defrag tool
            Function InstallNow()
            strComputer = "."
            set objShell = CreateObject("WScript.Shell")
            objShell.Run "RunDefr.exe /run", 1, True
		    window.close()
		    objShell.Run "complete.hta", 1, True
            End Function            
        '/--------------------------------------------------------------------------------------> 
        '/-> START THE HTA 
            Function StartHta()
             window.resizeTo 840,450
             window.moveTo 100,155
            End Function
        '/--------------------------------------------------------------------------------------> 
        </SCRIPT>
 
		</td>
		<td colspan="3" style="height: 250px">
		<iframe name="I1" src="readme.html" width="560" height="337"
        Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></td>
		<td style="width: 27%">
&nbsp;</td>
		<td colspan="3">
<p align="right"><font face="Tahoma" size="1">FTC&nbsp;&nbsp;&nbsp; </font></td>
	</tr>
    </table>
</body>
</html>

Open in new window

HTML

Avatar of undefined
Last Comment
mish_p

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
kevp75

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Renfroe

ASKER
Thank you.
mish_p

it does not work for me..i wrote  style="margin:0 auto;"  still it does not center the frame content.

can you please tell me if something needs to be changed.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23