Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Setting - ASP:Table Height to 100%

Setting - ASP:Table Height to 100%

Scheduled Pinned Locked Moved ASP.NET
questioncsharphtmlsysadmincloud
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AssemblySoft
    wrote on last edited by
    #1

    I am trying to create a table for layout. Simple header, content and footer sections (rows). I want the header to sit flush against the top of the page and the footer to sit at the bottom of the page. The content section should fill the available space. I thought setting the height of the table to 100% would accomplish this but there appears to be problems. Is there a neat solution to this problem? What is the workaround? Code shown below: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <asp:Table Width="100%" Height="100%" BackColor="Azure" runat="server"> <asp:TableRow> <asp:TableCell Height="50px">top</asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell BackColor="Beige"> <form id="form1" runat="server"> <div> mid </div> </form> </asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell Height="50px" BackColor="BlanchedAlmond">bottom</asp:TableCell> </asp:TableRow> </asp:Table> </body> </html>

    M 1 Reply Last reply
    0
    • A AssemblySoft

      I am trying to create a table for layout. Simple header, content and footer sections (rows). I want the header to sit flush against the top of the page and the footer to sit at the bottom of the page. The content section should fill the available space. I thought setting the height of the table to 100% would accomplish this but there appears to be problems. Is there a neat solution to this problem? What is the workaround? Code shown below: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <asp:Table Width="100%" Height="100%" BackColor="Azure" runat="server"> <asp:TableRow> <asp:TableCell Height="50px">top</asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell BackColor="Beige"> <form id="form1" runat="server"> <div> mid </div> </form> </asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell Height="50px" BackColor="BlanchedAlmond">bottom</asp:TableCell> </asp:TableRow> </asp:Table> </body> </html>

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      Try to use with CSS. Because there is some issues in using Width of table directly.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups