[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1301
  • Last Modified:

how to set <asp:table height width

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!!!
3 Solutions
Set height and width to "100%"
CollindsouzaAuthor Commented:
i tried that.. but i does'nt work...
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.
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now