I have a HTML table (black) which fills a window (blue). The table contains two rows.
When I resize the window, row 1 (red) height must be variable and row 2 (green) height constant.
Row 1 content is are dynamically generated (a tab strip and a tree view - both Telerik).
Row 2 contains two columns.
In other words, how to make the row 1 autosize itself when the windows is resizes?
All I have done, so far, is this:
<table style="width:100%;">
<tr style="height:100%;vertical-align:top;overflow:auto">
<td colspan="2">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" Width="100%" Height="100%">
<Tabs>
<telerik:RadTab runat="server" Text="Tab1" Selected="True">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Tab2">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%" SelectedIndex="0" Height="100%">
<telerik:RadPageView ID="RadPageView1" runat="server" Height="100%" style="border: 1px solid grey">
<telerik:RadTreeView ID="RadTreeView1" runat="server"></telerik:RadTreeView>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView2" runat="server" Height="100%" style="border: 1px solid grey">
<telerik:RadTreeView ID="RadTreeView2" runat="server"></telerik:RadTreeView>
</telerik:RadPageView>
</telerik:RadMultiPage>
</td>
</tr>
<tr>
<td style="font: normal 12px arial; text-align: left;">
<asp:CheckBox ID="CheckBox1" runat="server" Text="Do something when checked." AutoPostBack="true" />
</td>
<td style="text-align: right">
<telerik:RadButton ID="CancelButton" runat="server" Text="Cancel" OnClientClicked="windowClose" UseSubmitBehavior="false">
</telerik:RadButton>
</td>
</tr>
</table>
Simple answer for a simple question. Set a relative height (%) for first row and a fixed height (px) for second row!
<table style="width:100%;">
<tr style="height:100%;vertical-align:top;overflow:auto">
....
</tr>
<tr style="height:100px;">
....
</tr>
</table>
Adjust the 100px to whatever height Row 2 must have.
Also, set the table's height to the window's height using javascript and onload method.
The javascript would be:
document.onload = new function(){
var theTable = document.getElementById("myTable");
theTable.style.height = (document.height)+"px";
}
See fiddle.
add this on whichever row you wish to auto -size , even height also you can give it % rather than PX ,like
<tr style="width:10%;height:20px;">
<td style="font: normal 12px arial; text-align: left;">
<asp:CheckBox ID="CheckBox1" runat="server" Text="Do something when checked." AutoPostBack="true" />
</td>
<td style="text-align: right">
<telerik:RadButton ID="CancelButton" runat="server" Text="Cancel" OnClientClicked="windowClose" UseSubmitBehavior="false">
</telerik:RadButton>
</td>
</tr>
Related
on my page I have a table with a few elements in it, but it messes up in Internet Explorer 11. Any help appreciated
Here is what it looks like in VS:
In Chrome:
And here IE:
My Code:
<table>
<tr>
<td style="width: 50%; text-align: left"><br /><br /><br />
<asp:Label ID="lbl_dm_rvi" runat="server" Text="sometext RVI"></asp:Label><br />
<asp:Label ID="lbl_dm_odv" runat="server" Text="sometext ODV"></asp:Label>
</td>
<td style="width: 50%; text-align: right; text">
<asp:Label ID="lbl_hochrechnung" runat="server" Text="Hochrechnung_RX_SM_KVBEZ"></asp:Label><br />
<asp:Label ID="lbl_modul1" runat="server" Text="Modul 1"></asp:Label><br />
<asp:Label ID="lbl_modul_30" runat="server" Text="Modul 3.0"></asp:Label><br />
<asp:Label ID="lbl_modul_31" runat="server" Text="Modul 3.1"></asp:Label><br />
<asp:Label ID="lbl_modul3" runat="server" Text="Modul 3"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<img src="klammer.png" style="width: 400px"/>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_modul2" runat="server" Text="Modul 2"></asp:Label><br />
<asp:Label ID="lbl_odv" runat="server" Text="ODV"></asp:Label><br />
<asp:Label ID="lbl_modul2a" runat="server" Text="Modul 2a"></asp:Label><br />
<asp:Label ID="lbl_modul4" runat="server" Text="Modul 4"></asp:Label><br />
<asp:Label ID="lbl_modul4a" runat="server" Text="Modul 4a"></asp:Label>
</td>
</tr>
</table>
What I see at the first is that the table on IE is take the full width, the other two are not.
This is usually done because its browser did not have the same default setting for all elements.
A quick solution is to set the width on the table as
<table style="width: 300px;" >
so you not left it random.
You can also try to use any "Reset CSS" (like Eric Meyer’s) thats try to bring all browser styles to the same point.
Related: What is the easiest or fastest way to make CSS render the same in all browsers
I have a link on update panel,when i clicked on Cure Loan,model extender pop up should come up but instead of one popup all the popup on the page is come up
so please give me the solution how to use update panel with model extender pop up
here is my code
<asp:UpdatePanel ID="UPCureLoan" runat="server">
<ContentTemplate>
<td style="border: 0.5px solid #000000; border-collapse: separate; height: 44px;" bgcolor="#CCCCCC">
<asp:Label ID="CFMessage" runat="server" Visible="False"></asp:Label>
<br />
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click">Cure Loan</asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="click" />
</Triggers>
Panel->
<table style="width: 100%; background-color: #DDE2E5;">
<tr style="background-color: #522E8B; color: white; height: 50px">
<td colspan="4" style="text-align: center; font-size: medium"><b>Notification</b></td>
</tr>
<tr>
<td>
<br />
<br />
</td>
</tr>
<tr>
<td colspan="3" style="font-size: medium;"> I confirm that I have discussed the borrowers concerns with the borrower.<br />
Please enter your initials to confirm
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<br />
<br />
</td>
</tr>
<tr>
<td></td>
<td colspan="3" style="text-align: center">
<asp:CheckBox ID="CheckBox4" runat="server" Style="transform: scale(2) !important;" Height="20px" Width="20px" /><b> Resend Borrower Survey 1 </b></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr style="text-align: center">
<td> </td>
<td>
<td>
<asp:Button ID="Button4" runat="server" Text="Close" Height="30px" Width="120px" />
<asp:Button ID="Button5" OnClick="popupConfirm1" runat="server" Text="Confirm" Height="30px" Width="120px" /></td>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<%-- <cc1:CalendarExtender ID="CalendarExtender2" TargetControlID="TXTDate" Format="MM/dd/yyyy" runat="server" />--%>
</asp:Panel>
Model extender Popup->
ID="Modalpopupextender5" runat="server"
PopupControlID="Panel5" TargetControlID="hidForModel"
BackgroundCssClass="gridView" OkControlID="ButtonSave">
</cc1:ModalPopupExtender>
You are not using the UpdatePanel control properly.
All you're doing there is placing some HTML code (which is incorrect) inside the ContentTemplate.
<ContentTemplate>
<%-- Where is your <table> etc? --%>
<td style="border: 0.5px solid #000000; border-collapse: separate; height: 44px;" bgcolor="#CCCCCC">
<asp:Label ID="CFMessage" runat="server" Visible="False"></asp:Label>
<br />
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click">Cure Loan</asp:LinkButton>
</ContentTemplate>
You also have your other code outside of the UpdatePanel.
All your code that has to be controlled by the Panel and the modalpopup, must be inside the UpdatePanel. BUT your ModalPopupExtender itself can be outside the UpdatePanel. In fact, it should if you're treating the UpdatePanel as a "popup box".
This is how I use UpdatePanels with AJAX:
Firstly set up your styles for the background, the panels and the popup itself.
<style type="text/css">
.pnlCIR
{
position: absolute; top: 20%; left: 22%; width: 400px; border: 3px solid LightSlateGray;
background-color: #E0E8F0; padding: 3px; font-family: Arial; font-size: small;
}
.modalBackground
{
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
position:fixed;
overflow:hidden;
}
</style>
Next define your AJAX popup:
<asp:Button ID="btnCIR" runat="server" Text="Suggest Improvement (CIR)" CausesValidation="false" />
<ajaxToolkit:ModalPopupExtender ID="mpeCIR" runat="server"
BackgroundCssClass="modalBackground"
PopupControlID="upCIR"
TargetControlID="btnCIR">
</ajaxToolkit:ModalPopupExtender>
Next define your UpdatePanel as a "wrapper" around your code that you want to be inside the panel (in my case the "CIR" panel)
<asp:UpdatePanel ID="upCIR" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlCIR" runat="server" CssClass="pnlCIR" Width="700px">
<your code>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
Note:
You must use UpdateMode conditional
You must have a Panel inside the UpdatePanel, so that the Panel is the actual popup, and the UpdatePanel is the control that keeps postbacks inside the UpdatePanel, avoiding the dread "postback flash" on your entire screen.
Here what I've done and whats my problem. First of all i got a big table with a lot of td the first td on top of my table containt anoter table and (here come my problem) theres a space under that little table and I don't know why.
Here's the code for my table:
<div runat="server" class="ReportPage" >
<table runat="server" class="ListReportBigTable" align="center">
<tr>
<td class="style13" colspan="3" >
<table width="46%" align="center"style="height:50%; "cellpadding="0">
<tr>
<td align="left">
<asp:Label ID="LB_ChooseReport" runat="server"
Text="Choisissez un dossier médical: " Font-Size="Small">
</asp:Label>
</td>
</tr>
<tr>
<td style="vertical-align:bottom" align="left">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<div id="div_Filter" runat="server" visible="false" align="left">
<asp:Label ID="LBL_FilteredBy" runat="server" width="18%" Text="Patient : "
Font-Size="Small" style="margin-left: 0px"></asp:Label>
<asp:DropDownList ID="DDL_FilterSelect" runat="server" AutoPostBack="true"
Width="25%" CssClass="DDL_Filter" Font-Size="Small" Height="18px"></asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel></td></tr></table>
<br />
</td>
and here the CSS:
.ListReportBigTable
{
height:25%;
width:55%;
text-align:center;
vertical-align:middle;
border: thick solid black;
margin-left: 0px;
}
thx in advance
I don't know if it's a typo but you are closing with a </td> after your closing </table> tag. In addition you have a <br /> before the closing misplaced </td> which would obviously add space to the bottom.
Try changing the closing </td> to </table></div> and removing the <br />
In addition, in your CSS try adding margin-bottom: 0px; and padding-bottom: 0px; to see if this has an effect.
Also, what is after the table? Maybe whatever is being displayed after the table has it's own top margin/padding?
Do you have a link to the actual page where this is occuring so we can examine with Firebug or similar and try to figure it out?
I'm using a datalist to display images. There are two columns per row but the spacing between the columns is too little. Is there a way to place a fixed spacing between the columns?
<td class ="DLSettings">
<asp:DataList ID="DlReviewImages" runat="server"
RepeatColumns="2" RepeatDirection="Horizontal"
HeaderStyle-VerticalAlign="Top">
<ItemTemplate>
<table >
<tr>
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" class="tableborder">
<tr>
<td align="center">
<a href="" target="_blank" runat="server" id="AImage">
<img runat="server" id="ThumbnailReviewImage" width="250" height="200" border="0"/> </a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
CSS :
.DLSettings{
border-width:1px;
border-color:Black;
border-style:solid;
background-color: #E3E3E3;
padding:5px 10px 30px 30px;
}
Thanks in advance
BB
I would just use the CellPadding property to increase the spacing between columns:
<asp:DataList ID="DataList1" runat="server" CellPadding="5" ...>
You don't need either of the tables in your ItemTemplate either. They're just taking up space and slowing things down. Try using the ItemStyle for alignment instead:
<asp:DataList ID="DlReviewImages" runat="server" RepeatColumns="2" CellPadding="5" RepeatLayout="Table" RepeatDirection="Horizontal" HeaderStyle-VerticalAlign="Top">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<a href="" target="_blank" runat="server" id="AImage">
<img runat="server" id="ThumbnailReviewImage" width="250" height="200" border="0"/>
</a>
</ItemTemplate>
</asp:DataList>
You could add padding to the right of the table cells, so in the css...
td{ padding-right: 10px; }
I have table with couple of textboxes in it. In those 2 fields I have required fields. When validators fire alignment is changing. Before the validators fire, textboxes aligntment is good.
Pic1 for after validator fires.
Pic2 for before validator fires.
Here is the HTML.
<table class="Borderblue" id="Table26" cellspacing="3" align="center" style="width: 100%;">
<tr>
<td bgcolor="White" style="width:20%" >
First Name <br/>
(on website)
</td>
<td bgcolor="White" style="width:20%" >
Middle Intial <br/>
(on website)
</td>
<td bgcolor="White" style="width:20%" >
Last Name <br/>
(on website)
</td>
<td bgcolor="White" style="width:20%" >
Nick Name <br/>
(Goes By Name)
</td>
</tr>
<tr>
<td bgcolor="White" style="width:20%" >
<asp:TextBox ID="txt6_2" runat="server" CssClass="TextBox SmallText" ></asp:TextBox>
<asp:RequiredFieldValidator runat="server" id="RequiredFieldValidator8" ValidationGroup="ValidateInsert" Display="Dynamic" controltovalidate="txt6_2" errormessage="Please enter first name!" />
</td>
<td bgcolor="White" style="width:20%">
<asp:TextBox ID="txt7_2" runat="server" CssClass="TextBox SmallText" MaxLength="2" Width="20px" style="vertical-align:top" ></asp:TextBox>
</td>
<td bgcolor="White" style="width:20%">
<asp:TextBox ID="txt8_2" runat="server" CssClass="TextBox SmallText"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" id="RequiredFieldValidator9" ValidationGroup="ValidateInsert" Display="Dynamic" controltovalidate="txt8_2" errormessage="Please enter last name!" />
</td>
<td bgcolor="White" style="width:20%" >
<asp:TextBox ID="txt9_2" runat="server" CssClass="TextBox SmallText" width="120px"></asp:TextBox> </td>
</tr>
</table>
CSS:
.SmallText
{
font-family: Tahoma, Arial, Helvetica;
text-align:justify;
font-size: 8.5pt;
}
.TextBox
{
Width: 100px;
Height:12px;
background-color:#F0F0F0;
border: 1px solid #000000;
}
You'll probably need to move the validators to their own cells so the text box cells aren't expanded. Or valign="top" on your cells might work.