T.T.T. T.T.T. - 1 year ago 67
HTML Question

html footer moves to right when table is empty?

Have a table of data surrounded by form tags. At the bottom of the page have a footer that is fixed.

When the table is empty (only table header displaying) the entire footer shifts half way off the screen, to the right.

Any ideas?

<form action="/cgi-bin/Lib.exe" method=POST name="dd" ID="Form1">
<div id="yyy">

<table cellspacing="0" ID="Table1">


<p><small><font face="Arial"><small>$DATA</small></font></small></p>


<td><input type=radio name="begin" value="$START" ID="Radio0"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio3"></td>

<td><input type=radio name="begin" value="$START" ID="Radio1"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio4"></td>

<td><input type=radio name="begin" value="$START" ID="Radio2"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio5"></td>

<p><small><font face="Arial"><small>$DATA</small><strong></p>



<div id="footer">
<div id="labfooter">


The CSS:

#footer {
html>body #footer {
z-index:10; /* Prevent certain problems with form controls */

#footer {

Answer Source

It's hard to debug without having more of your code. Also which browser(s) and OS you are having the problems with?

But, I can say that your html code is not valid, and that can throw off many browser renderings. Sometimes it may look like it runs well, but the DOM can be thrown way off from improper code.

For start try removing the <p>...</p> in between the <thead> and <tbody>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download