the table should cover the whole screen because of the percentages. I want the word test at the bottom of the screen, but it's not working? any better methods?

<table width="100%" height="100%" border="0">
  <tr>
    <td valign="bottom">test</td>
  </tr>
</table>

Dani AI

Generated

's table example fails because percentage heights only work when ancestor elements have an explicit height. If html and body are auto, height:100% on the table has no reference, so the cell cannot push its content to the bottom. As noted, tables are not ideal for layout; CSS layout techniques separate content from presentation and are more predictable.

A modern, simple pattern is flexbox: make a page wrapper a column flex container, let the main content grow, and keep the footer/menu as the last element so it sits at the bottom for short pages and flows after content on long pages.

<div class="page">
  <main>...content...</main>
  <footer>test</footer>
</div>
html, body { height:100%; margin:0; }
.page { min-height:100vh; display:flex; flex-direction:column; }
main { flex:1; }
footer { /* bottom menu styling */ }

For a menu that must always remain visible while scrolling, fixed positioning is an option (as suggested) but it overlays page content; compensate by adding bottom padding to the main area equal to the menu height. Beware mobile browser behavior with 100vh (address bar visibility can change the viewport); see the MDN flexbox guide and the viewport unit notes for compatibility details: MDN Flexbox guide | .

Recommended Answers

All 2 Replies

<div style="width:100%; bottom:0; top:auto; position:fixed; text-align:center">test</div>

one of many ways, styles belong in the stylesheet
tables are not used for layout, too much code too little content, current best practice is css positioning, separates layout from content, makes constant appearance simple

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.