unable to move header to center even align is centered - html

I need to move personal account to center and gave align as centre but still not working. I don't have any clue where am lagging.
<table cellspacing="1" cellpadding="0" width="750" align="center" bgColor="#000000" border="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="750" align="center" bgcolor="#ffffff">
<tr>
<td width="34%" bgcolor="#ff0000" colspan="5">
<div class="mainheader">Personal & Account
</div>
</td>
<td width="33%" bgcolor="#ff0000">
<div align="right">
<button class="button" id="btnLogin" accessKey="P" type="button" runat="server">Login </button>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>

Indeed as mentioned in the comment by j08691, try avoiding tables for layout.
For a solution to your issue, I'll keep your tabular layout as I want to keep up with your question's code, but here's a solution which starts with removing the second inner td - as you dont need it for floating the button to the right side.
I've changed your two columns to one column and inside of this column inserted a div with the desired layout - a text in the middle and a button in the right side.
The button is floated right by "float: right;" and the text is aligned to the center of the div by "text-align: center". Try using the same approach for future layout design.
Here is a working example with the below code:
<table cellspacing="1" cellpadding="0" width="750" align="center" bgColor="#000000" border="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="750" align="center" bgcolor="#ffffff">
<tr>
<td width="34%" bgcolor="#ff0000" colspan="5">
<div class="mainheader" style="text-align: center">Personal & Account
<button class="button" id="btnLogin" accesskey="P" type="button" runat="server" style="float: right;">Login </button>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>

<tr>
<td bgcolor="#1f4e79" colspan="5">
<div class="mainheader" style="margin-left:325px;" >Restraint & Seclusion
</div>
</td>
<td width="33%" bgcolor="#1f4e79">
<div align="right">
<button class="button" id="btnLogin" accessKey="P" type="button" runat="server">Login </button>
</div>
</td>
</tr>

Related

How do I prevent text from different table from appearing on a picture html email code

So I place a picture in first table to position absolute to have text appear above it but the problem I'm having now is the table below text is also appearing on the image. How Do I prevent this from happening ?
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="">
<tr>
<td>
<img src="img/suit1.jpeg" width="590px;" height="500px;" style="position:absolute">
<h1>each</h1>
<button>SHOP Now</button>
</td>
</tr>
</table>
</td>
</tr>
<!-- end of row 3 -->
<!-- start of row 4-->
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="">
<tr>
<td>
<h1>hello</h1>
</td>
</tr>
</table>
</td>
</tr>
Please try applying position: absolute to text elements. In my solution, i've wrapped text inside a div and applied position: absolute property. Also, i've applied position: relative to the parent element of both image and text.
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="">
<tr>
<td style="position:relative;">
<img src="img/suit1.jpeg" width="590px;" height="500px;">
<div style="position:absolute; top: 0; left: 10px;">
<h1>each</h1>
<button>SHOP Now</button>
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- end of row 3 -->
<!-- start of row 4-->
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="">
<tr>
<td>
<h1>hello</h1>
</td>
</tr>
</table>
</td>
</tr>

Not able to click element which is in div and hidden

I am not able to click the element which is in div and is hidden. Tried Action builder and JS executor still not able to click. Below is the html sample.
This is partial html i have shared. On mouse hover the "Simulate button" will active to click.
Please do help me.
<div id="isc_MR" style="POSITION:relative;VISIBILITY:inherit;Z-INDEX:204302;CURSOR:pointer;" eventproxy="isc_Button_105">
<table width="100%" height="100%" cellspacing="0" cellpadding="0"
style="table-layout:fixed;overflow:hidden;">
<tbody>
<tr>
<td class="button" valign="center" nowrap="true" align="center"
onfocus="isc_Button_105.$47()" tabindex="-1" '="" style="padding-
top:0px;padding-bottom:0px;">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="button"
style="margin:0px;border:0px;padding:0px;background-
image:none;background-color:transparent;font-size:1px;padding-
right:6px"><img width="16" height="16" border="0" align="absmiddle"
suppress="TRUE" eventpart="icon" style="vertical-align:middle"
name="isc_MRisc_Button_105$4u" src="http://test2.mond-
cloud.com/mond03/images/silk/simulate.png">
</td>
<td class="button" nowrap="true"
style="margin:0px;border:0px;padding:0px;background-
image:none;background-color:transparent;">Simulate</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>

Re-sizable ads on sides of page without table

I created a mockup which includes a content area and two expandable/collapsible ads on the left and right.
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td style="background:blue; text-align:right;"><img src="http://www.citiesmatter.org/vertical/Sites/%7BC2C0C8B8-8BB9-430D-B364-373386495DE7%7D/uploads/%7B42CEE0EB-39AA-469A-8A71-F6733F2A9172%7D.GIF" style="width:100%;" /></td>
<td style="width:400px; background:red;">
<p>Content</p>
</td>
<td style="background:blue;"><img src="http://www.citiesmatter.org/vertical/Sites/%7BC2C0C8B8-8BB9-430D-B364-373386495DE7%7D/uploads/%7B42CEE0EB-39AA-469A-8A71-F6733F2A9172%7D.GIF" style="width:100%;" /></td>
</tr>
</table>
http://jsfiddle.net/DVevt/1/
Is it possible to do this with only divs?

How do I get a group of text and listboxes to properly vertically align with even spacing between?

I am constructing a webpage using fairly elementary techniques. I have three rows on a certain part of the webpage, each of which is structured as . The text units and the listbox units of the different rows are in perfect horizontal alignment, but the vertical spacing between the listboxes is inconsistent. Furthermore the vertical alignment of each listbox in relation to its paired text is different. I've tried readjusting the table structure and experimenting with valign, but to no avail. How do I fix this so that it looks neat? Thanks!
You could set the height of each td by css like
td {
height: 50px
}
also you should check out some tutorials on how to design forms without using tables http://www.cssdrive.com/index.php/examples/exampleitem/tableless_forms/
<form>
<table border="0" width="100%" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellpadding="0">
<tr>
<td align="right" width="50%">
Please choose the test category:
</td>
<td align="left" width="50%">
<form action="">
<select name="categories" style="width:20%;"></select>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table border="0" width="100%" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellpadding="0">
<tr>
<td align="right" width="50%" valign="center">
Please choose the test:
</td>
<td align="left" width="50%" valign="center">
<form action="">
<select name="tests" style="width:20%;"></select>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table border="0" width="100%" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellpadding="0">
<tr>
<td align="right" width="50%">
Please choose the difficulty:
</td>
<td align="left" width="50%">
<form action="">
<select name="difficulties" style="width:20%;"></select>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
This is only the present state. I've tried other things with it.
Edit:
That includes the non-existence of any valign things in there. When I tried adding them, nothing happened.

css Table-layout

Why is content in the table appears to start from the center.How to make it to start from where the row starts
<table style="table-layout:fixed;width:100%;" border="1" cellpadding="0" cellspacing="0" class="main_table" id="main_table">
<tr>
<td width="20%" height="70px" align="center" id="plugins" class="step step1 clickable" step="1" onclick="javascript:getresource('1','0');">
<font color="blue">Plugins</font>
</td>
<td rowspan="5" width="80%" height="100%" align="center" ><br>
<div id="status" class="msg" style="display:none"><br></div>
<div id="header_msg" height="100%" align="center"></div>
<div id="contents" height="100%"></div>
</td>
</tr>
</table>
Remove 'align="center"' from both td's and the 2nd div, and if you want the data to start at the top of the cell, add 'valign="top"' to the tr ie:
<table style="table-layout:fixed;width:100%;" border="1" cellpadding="0" cellspacing="0" class="main_table" id="main_table">
<tr valign="top">
<td width="20%" height="70px" id="plugins" class="step step1 clickable" step="1" onclick="javascript:getresource('1','0');">
<font color="blue">Plugins</font>
</td>
<td rowspan="5" width="80%" height="100%"><br>
<div id="status" class="msg" style="display:none"><br></div>
<div id="header_msg" height="100%"></div>
<div id="contents" height="100%"></div>
</td>
</tr>
</table>
Apart from the bloated use of inline CSS, HTML tables for layouts and the not-so-popular -tag, I'd guess it's the..
align="center"
..that centers your content. Try replacing it with "left" instead. Do consider doing it the CSS way though:
text-align: left;
Use vertical-align:top