how to set <asp:table height width

Posted on 2007-09-28
Last Modified: 2012-06-27
I have the following  .aspx page

<body scroll="no">
<asp:Table runat="server" ID="tblScreen">
        <asp:TableRow runat="server" ID="trHead" Visible="false">
            <asp:TableCell ID="TimeSinceRefresh" runat="server"></asp:TableCell>
        <asp:TableRow runat="server" ID="trBody" BackColor="black">
            <asp:TableCell runat="server">
                <iframe runat="server" id="iContent" frameborder="0"></iframe>

I have 2 questions
1. How can i set the asp:table Height, Width to be exactly that of the page.
2. How can i make the iFrame which is part of the row "trbody" to occupy the entire table space.

Please help me!!!
Question by:Collindsouza
    LVL 42

    Accepted Solution

    Set height and width to "100%"
    LVL 5

    Author Comment

    i tried that.. but i does'nt work...
    LVL 37

    Assisted Solution

    there's some CSS that needs to be applied to the page and the table also for a "full height" table to work consistently:

    you can do a "view source" on the very last example on the page.
    LVL 26

    Assisted Solution

    can you please post the code that did not work .. setting it to 100% should have worked .. did you set that to the iframe too and you will also need to set that for the row and column where the iframe is .. ?

    <asp:Table runat="server" ID="tblScreen" style="height:100%;width:100%">
            <asp:TableRow runat="server" ID="trHead" Visible="false" >
                <asp:TableCell ID="TimeSinceRefresh" runat="server"></asp:TableCell>
            <asp:TableRow runat="server" ID="trBody" BackColor="black" style="height:100%;width:100%">
                <asp:TableCell runat="server" style="height:100%;width:100%">
                    <iframe runat="server" id="iContent" frameborder="0" style="height:100%;Width:100%;"></iframe>

    in the code above, as per your requirement, you might have to tweek the percentages for the table column and row where the iframe is placed ..


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Jquery oncheck to update SPAN 31 34
    popup message 3 18 markup problem with table alignment 2 13
    Newbie CSS questions 4 14
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now