Table position (table goes down when it shouldn't) - html

Here is my code:
<form id="form1" style="height: 800px; width:1000px" >
<table style="width: 90%; height: 193;">
<tr>
<td class="style4">
<table style="width: 100%; height: 701px;">
<tr>
<td style="height: 587px; width: 629px;" colspan="4" >
<div id="tableTree" style="height:600px;">
<table style="width: 150px;">
<div id="treeboxbox_tree" style="width:280px; height:100%; ">
</div>
</table>
</div>
</td>
</tr>
<tr>
<td >
<input type="button" value="Add" id="btnAdd" onclick="return someMethod()" />
</td>
<td >
//other button
</td>
<td >
//other button
</td>
</tr>
</table>
</td>
<div>
<td>
<table width="100%" id="smth">
<div style="float:left"><%Html.RenderPartial("Something"); %></div>
</table>
</td>
</div>
</tr>
</table>
</form>
And smth is not shown until I click on a button. But since smth has very large height, the td which has style4 goes down, where the middle of smth is. It is very frustrating. How to resolve it?

I think you mean the vertical alignment is off in the td?
<td class="style4">
Change it to
<td class="style4" valign="top">
Or add to style4
vertical-align: top;
Not sure which version of html you are defining...

Related

HTML: Place table right aligned in other table cell

I want a table inside of a td of another table to be aligned at the right side.
<table style="width: 100%;">
<tr>
<td style="text-align:right;">
<table style="width: 200px; table-layout: fixed; background-color:blue">
<tr>
<td>
<input style="width:100%" type="button" value="OK" />
</td>
<td>
<input style="width:100%" type="button" value="Abbrechen" />
</td>
</tr>
</table>
</td>
</tr>
</table>
As you can see, the inner table is shown at the left side. How to accomplish?
Just add display: inline-table; to the inner table. Otherwise the text-align parameter won't apply, since it only applies to inline elements.
<table style="width: 100%">
<tr>
<td style="text-align:right;">
<table style="width: 200px; table-layout: fixed; background-color:blue; display: inline-table;">
<tr>
<td>
<input style="width:100%" type="button" value="OK" />
</td>
<td>
<input style="width:100%" type="button" value="Abbrechen" />
</td>
</tr>
</table>
</td>
</tr>
</table>

html:converting block tags to inline tags

i am designing a webpage which includes two tables.here is my code
<div>
<table style="width: 50%; height: 377px;">
<tr>
<td rowspan="4"><EMBED style="margin-left:20px" SRC="nesaranodu.mp4" WIDTH="500px" HEIGHT="400px" AUTOPLAY="FALSE" LOOP="false"></EMBED> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table style="width: 50%; height: 377px;display:inline-block;">
<tr>
<td> </td>
<td> </td>
<td align="right" style="padding:0px;color:white" >mobile number:</td>
<td><input name="Text1" type="text" /><h3 style="color:red;"><?php echo $mnoerr;?></h3>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right" style="padding:0px;color:white">password</td>
<td><input name="Text2" type="password" /><h3 style="color:red;"><?php echo $passerr;?></h3>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
<td ><input name="Submit1" type="submit" value="change address" />
<input onclick="document.location.href='regforswa.php'" name="Submit2" type="button" value="register" /><br/>
forgot password<h3 style="color:red;"><?php echo $success;?></h3></td>
</tr>
</table>
</div>
and i want to display it side by side.i used display:inline-block property but it is not working fine.please suggest me what i have to do.
http://jsfiddle.net/CHC67/
<div class=left>
//First table
</div>
<div class=right>
//Second table
</div>
<style>
.left {
width:50%;
float: left;
}
.right {
width 50%;
float: left;
}
</style>
Should really be doing this with divs rather than tables.
Try using floats on both tables:
<table style="width: 50%; height: 377px; float:left;">
Please make sure to set the width on the EMBED accordingly..
Otherwise it will grow over the 50% depending on the display size..

Cross Browser alignment issue with select object

I have been agonizing over this, the alignment of my third table row is complete messed when viewed either Firefox or Chrome but look exactly as expected in IE9.
I have tried using style (text-align, width, margin-left, overflow, etc...) and direct align, width. etc.... When creating the width, I have tried using % and direct pixel values.
The parent table has a width 400px, or at least is should because that is the width of the parent TD and table width is 100% and cellpadding and cellspacing is 0.
<table align="center" style="width: 650px; border-style: none" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 250px;"><img src="../images/incidentmonitor.gif" alt="" /></td>
<td style="text-align: center; width: 400px">
<!-- Login section Table -->
<table align="center" style="width: 100%; border-style: none;" class="clsLoginTable" cellpadding="0" cellspacing="0">
<tr>
<td style="text-align: right; width: 25%; overflow: hidden;"> </td>
<td style="text-align: right; width: 5%; overflow: hidden;"> </td>
<td style="text-align: left; width: 70%; overflow: hidden;"> </td>
</tr>
<tr>
<td colspan="3" class="clsLoginLabel" style="text-align:center;">
<p><b>Please enter your User ID and Password</b><br /><br /></p>
</td>
</tr>
<tr>
<td style="text-align: right;" class="clsLoginLabel">User ID:</td>
<td style="text-align: right;"> </td>
<td style="text-align: left;"><input name="UserID" value="administrator" size="20" /></td>
</tr>
<tr>
<td style="text-align: right;" class="clsLoginLabel">Password:</td>
<td style="text-align: right;"> </td>
<td style="text-align: left;"><input autocomplete="off" type="password" name="Password" onkeydown="SendForm(event.keyCode)" size="20" /></td>
</tr>
<tr style="display: block;">
<td align="right" width="25%" class="clsLoginLabel">Domain:</td>
<td align="right" width="5%"> </td>
<td align="left" width="70%">
<select id="DomainName" name="DomainName" size="1" style="width: 200px">
<option selected="selected" value='' >Built-In</option>
<option value='dnsdev.com' >dnsdev.com</option>
<option value='dnsdev.org' >dnsdev.org</option>
</select>
</td>
</tr>
<tr>
<td colspan="3" style="text-align: center;">
<button id="submit_request" name="submit_request" class="clsButton" accesskey="L" onclick="Validate();return false" Title="Login to IncidentMonitor "><u>L</u>ogin</button>
</td>
</tr>
</table>
</td>
</tr>
</table>

Why my html table is getting out of my div?

I have a html table inside a div but the table is getting out of the div's width, here is what I am doing:
<div style="width: 920px">
<table style="width: 100%;">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
this is not working
You have an empty layout so there is nothing to see. If you add height, you can see how it looks:
<div style="width: 920px;border:1px solid red;height:500px;">
<table style="width: 100%;" border="1">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>​
EXAMPLE
Try adding some attributes to the table to ensure there is no cell spacing:
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">

RTL mode in IE makes field labels align incorrectly in ExtJS 3.3.0 Window Form

I am working with ExtJS 3.3.0 with an RTL fix, and I have an override on all of the required classes to align the fields correctly.
I keep having an issue with floating forms, though, where my field labels sometimes disappear. I have investigated the issue, and discovered that the label is not actually gone - it has just popped over to the left (and therefore doesn't show) for no discernable reason.
Here is what my dialog should look like (and does the first time it's shown):
Unfortunately, here is what it looks like the second time it gets shown:
This is the window HTML as created by ExtJS (Note: the HTML of the document is marked dir="rtl"):
<div class="x-window-tl">
<div class="x-window-tr">
<div class="x-window-tc">
<div style="mozuserselect: none; khtmluserselect: none" id="ext-gen129" class="x-window-header x-unselectable x-window-draggable"
unselectable="on">
<div id="ext-gen135" class="x-tool x-tool-close">
</div>
<span id="ext-gen141" class="x-window-header-text">שינוי תאריך אספקה</span>
</div>
</div>
</div>
</div>
<div id="ext-gen130" class="x-window-bwrap">
<div class="x-window-ml">
<div class="x-window-mr">
<div id="ext-gen134" class="x-window-mc">
<div style="width: 297px; height: 40px" id="ext-gen131" class="x-window-body">
<div style="width: 297px" id="ext-comp-1046" class=" x-panel x-form-label-left">
<div id="ext-gen147" class="x-panel-bwrap">
<form style="padding-bottom: 8px; padding-left: 8px; width: 297px; padding-right: 8px; height: 40px; padding-top: 8px"
id="ext-gen128" class="x-panel-body x-panel-body-noheader x-form"
method="post">
<div style="width: 300px" dir="rtl" id="ext-gen149" class="x-form-item " tabindex="-1">
<label style="width: 75px" id="ext-gen150" class="x-form-item-label" for="ext-comp-1045">
תאריך חדש:</label>
<div style="padding-right: 80px" id="x-form-el-ext-comp-1045" class="x-form-element">
<div style="width: 133px" dir="rtl" id="ext-gen152" class="x-form-field-wrap x-form-field-trigger-wrap">
<input style="width: 133px" id="ext-comp-1045" class="x-form-text x-form-field x-trigger-noedit"
name="ext-comp-1045" readonly value="2012-11-22" size="10" autocomplete="off"
qtip><img id="ext-gen153" class="x-form-trigger x-form-date-trigger" alt="" src="http://localhost/bDox/NipImages/s.gif">
</div>
</div>
<div class="x-form-clear-left">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="ext-gen133" class="x-window-bl">
<div class="x-window-br">
<div class="x-window-bc">
<div style="width: 297px" id="ext-gen132" class="x-window-footer x-panel-btns">
<div style="width: 287px" id="ext-comp-1049" class="x-panel-fbar x-small-editor x-toolbar-layout-ct">
<table class="x-toolbar-ct" cellspacing="0">
<tbody>
<tr>
<td class="x-toolbar-right" align="center">
<table cellspacing="0">
<tbody>
<tr class="x-toolbar-right-row">
<td id="ext-gen142" class="x-toolbar-cell">
<table style="width: 75px" id="ext-comp-1047" class="x-btn x-btn-noicon" cellspacing="0">
<tbody class="x-btn-small x-btn-icon-small-right">
<tr>
<td class="x-btn-tl">
<i> </i>
</td>
<td class="x-btn-tc"></td>
<td class="x-btn-tr">
<i> </i>
</td>
</tr>
<tr>
<td class="x-btn-ml">
<i> </i>
</td>
<td class="x-btn-mc">
<em unselectable="on">
<button style="" id="ext-gen143" class=" x-btn-text">
אשר</button></em>
</td>
<td class="x-btn-mr">
<i> </i>
</td>
</tr>
<tr>
<td class="x-btn-bl">
<i> </i>
</td>
<td class="x-btn-bc"></td>
<td class="x-btn-br">
<i> </i>
</td>
</tr>
</tbody>
</table>
</td>
<td id="ext-gen144" class="x-toolbar-cell">
<table style="width: 75px" id="ext-comp-1048" class="x-btn x-btn-noicon" cellspacing="0">
<tbody class="x-btn-small x-btn-icon-small-right">
<tr>
<td class="x-btn-tl">
<i> </i>
</td>
<td class="x-btn-tc"></td>
<td class="x-btn-tr">
<i> </i>
</td>
</tr>
<tr>
<td class="x-btn-ml">
<i> </i>
</td>
<td class="x-btn-mc">
<em unselectable="on">
<button style="" id="ext-gen145" class=" x-btn-text">
ביטול</button></em>
</td>
<td class="x-btn-mr">
<i> </i>
</td>
</tr>
<tr>
<td class="x-btn-bl">
<i> </i>
</td>
<td class="x-btn-bc"></td>
<td class="x-btn-br">
<i> </i>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td class="x-toolbar-left" align="left">
<table class="x-toolbar-left-ct" cellspacing="0">
<tbody>
<tr>
<td>
<table cellspacing="0">
<tbody>
<tr class="x-toolbar-left-row">
</tr>
</tbody>
</table>
</td>
<td>
<table cellspacing="0">
<tbody>
<tr class="x-toolbar-extras-row">
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ext-gen137" class="x-clear">
</div>
</div>
</div>
</div>
</div>
</div>
<a id="ext-gen138" class="x-dlg-focus" tabindex="-1" href="http://localhost/bDox/Asn.aspx?n=20112112_18&cid=8ab8ba6a-1de0-4344-bed6-a48b93c497e6&vid=4cf57ca1-78ea-4d6a-94b5-cd20b322a2f8#"> </a>
Note: this only occurs in IE.
I have read several times that IE has issues with floating elements in RTL mode, and that the fix was to set the width to the container of the floating element.
I have done this on the after render event, but to no avail:
newDateField.on('afterrender', function (field) {
var elem = field.getEl(),
p = elem.parent(),
formItem = elem.parent('.x-form-item');
p.setWidth(elem.getWidth());
formItem.setWidth(300);
}, this);
I have also tried removing the DOCTYPE and using a STRICT DOCTYPE. Also no help.
Any suggestions?