I have a table in my html page, in the table the first tr has images and next tr has text and it look's good in IE and Chrome browser's like this
but when I use in Firefox browser it looks like this:
I just used CSS (text-align:center) for td and (border-collapse: collapse,width: 100%) for table that's all...
My html code:
<table class="foottable" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="foottabcen"><img id="check" src="images/unchecked.png"/></td>
<td class="foottabcen"><img id="export" class="image1" src="images/excelicon.png" /></td>
<td class="foottabcen"><img id="test" class="image1" src="images/mailicon.png" /></td>
<td class="foottabcen"><img id="sms" class="image2" src="images/smsicon.png"/></td>
<td class="foottabcen"><img class="image1" src="images/charticon.png" /></td>
<td class="foottabcen"><img id="print" class="image1" src="images/printericon.png"/></td>
</tr>
<tr>
<td class="foottabcen">Select all</td>
<td class="foottabcen">Export to excel</td>
<td class="foottabcen">Mail</td>
<td class="foottabcen">SMS</td>
<td class="foottabcen">Graph</td>
<td class="foottabcen">Print</td>
</tr>
</table>
My CSS code:
.foottable
{
width: 100%;border-top: 2px solid #D4D4D4;border-collapse: collapse;background: white;
}
.foottabcen
{
color:black;text-align: center;
}
please help me.........
Not sure why you would want to do this way but I guess the better way would have been putting the image and text in the same td like:
<td>
<a href="#">
<span><img src="images/exl_icon.png" alt="" /></span>
<small>Export to excel</small>
</a>
</td> /* <a> is added considering these are clickable elements */
and apply display:block; to 'a', 'span' and 'small' through your css.
and probably the best way would have been just use text as link in the td and add a icon specific class to it:
<td>
Export to excel
</td>
and in your css it will look like this:
.ico_excel{
display:block;
text-align:center;
padding-top: x px; /* x should be more than the height of the icon */
background: transparent url(images/exl_icon.png) center top no-repeat;
}
try this
<table class="foottable" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="foottabcen"><img id="check" src="images/unchecked.png"/></td>
<td class="foottabcen"><img id="export" class="image1" src="images/excelicon.png" /></td>
<td class="foottabcen"><img id="test" class="image1" src="images/mailicon.png" /></td>
<td class="foottabcen"><img id="sms" class="image2" src="images/smsicon.png"/></td>
<td class="foottabcen"><img class="image1" src="images/charticon.png" /></td>
<td class="foottabcen"><img id="print" class="image1" src="images/printericon.png"/></td>
</tr>
<tr>
<td class="foottabcen1">Select all</td>
<td class="foottabcen1">Export to excel</td>
<td class="foottabcen1">Mail</td>
<td class="foottabcen1">SMS</td>
<td class="foottabcen1">Graph</td>
<td class="foottabcen1">Print</td>
</tr>
</table>
and css...give height for foottabcen as per ur requirement
.foottable
{
width: 100%;border-top: 2px solid #D4D4D4;border-collapse: collapse;
background: white;
}
.foottabcen
{
color:black;text-align: center;height:50px;
}
.foottabcen1
{
color:black;text-align: center;
}
check demo here..... http://jsfiddle.net/dBFfd/
did you try this...
<table>
<tr>
<td>
<img id="check" src="images/unchecked.png"/>
<span>sample</span>
</td>
</tr
</table>
but if you want my free assistant just email your code i try to fix it....
Related
I'm a really really new beginner. I have been tasked with making an email signature by my boss and I cannot figure out how to produce it. I'm using dreamweaver and have written really basic HTML emails that sent successfully, so my code isn't the absolute worst.
I'm trying to recreate this (made in word):
I want the four lines to the right of the logo to be left-aligned, and the bottom two lines to be centered. I don't have any alignment defined in table {} or tbody tr td {}.
Here is how it looks in the chrome preview:
I will comment to show you how it looks in dreamweaver
in style:
table {
border-collapse: collapse;
border-spacing: 0;
}
tbody tr td {
font-family: sans-serif;
font-style: bold;
color: black;
font-size: 13px;
}
.B {font-size: 14px;
text-align: left !important;
}
.smallcaps {
font-variant: small-caps;
font-size: 14px;
text-align: left !important;
}
.bcorp {
font-variant: small-caps;
font-size: 14px;
text-align: center;
}
.pad {
padding-left: 12px;
padding-right: 12px;
vertical-align: bottom;
text-align: center;
}
a {
text-decoration: none;
text-align: center;
}
And in table>tbody:
<tr>
<td width="96" rowspan="6"><a><img src="http:///wp-content/uploads/2016/09/Logo-01.jpg" alt="Logo" width="96" height="90"/></a></td>
<td height="1" colspan="2"> </td>
</tr>
<tr>
<td height="9" colspan="2"><span class="B">Name Here, Position Title</span></td>
</tr>
<tr>
<td height="20" colspan="2"><span class=smallcaps>Company Name</span>.</td>
</tr>
<tr>
<td height="20" colspan="2">12345 SW 22 P<span class=smallcaps>kwy</span> | P<span class=smallcaps>ortland</span>, OR 97111 | S<span class=smallcaps>te</span> 123</td>
</tr>
<tr>
<td height="7" colspan="2">D<span class=smallcaps>esk</span>: 503.123.4567 | C<span class=smallcaps>ell</span>: 503.987.6543</td>
</tr>
<tr>
<td height="1" colspan="2"> </td>
</tr>
<tr>
<td colspan="2" cellpadding="5">
<a href="https://www.facebook.com/">
<img class="pad" src="small-icons-03-03-[1].jpg" width="25" height="25" alt="Facebook" href="https://www.facebook.com/"/>
</a>
<a href="https://www.facebook.com/">
<img class="pad" src="small-icons-03-03-[1].jpg" width="25" height="25" alt="Facebook" href="https://www.facebook.com/"/>
</a>
<a href="https://www.facebook.com/">
<img class="pad" src="small-icons-03-03-[1].jpg" width="25" height="25" alt="Facebook" href="https://www.facebook.com/"/>
</a>
<a href="https://www.facebook.com/">
<img class="pad" src="small-icons-03-03-[1].jpg" width="25" height="25" alt="Facebook" href="https://www.facebook.com/"/>
</a>
<a href="https://www.facebook.com/">
<img class="pad" src="small-icons-03-03-[1].jpg" width="25" height="25" alt="Facebook" href="https://www.facebook.com/"/>
</a>
</td>
<td> </td>
</tr>
<tr>
<td height="30" colspan="2"><span class=bcorp>A Certified B Corporation®</span></td>
<td width="101"> </td>
</tr>
Edited: added code - hope it's clear enough to help
Ok, please check this and see if this will help you. About the table issue.
Some Email program don't render Inline-CSS to the body of email. You may consider use the style attributes to support what Table design is missing. I used to do this when generating newsletter.
<table width="400" cellspacing="0" cellpadding="0" border="0" style="background:#EEE;font:small-caps 400 14px sans-serif;color:#444;">
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="middle" align="center" width="125" bgcolor="#DDDDDD">Logo Here</td>
<td style="line-height:1.6;padding: 5px 15px;">
<div>Name Here, Position Title</div>
<div>Company Name</div>
<div>Stress address wrapped around here</div>
<div>Desk: 123.456.789 | Cell: 123.456.789</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding: 5px;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td align="center">
<table align="center" width="50%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td> Icon1 </td>
<td> Icon2 </td>
<td> Icon3 </td>
<td> Icon4 </td>
<td> Icon5 </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
A Certified B Corporation <sup>®</sup>
</td>
</tr>
</table>
</td>
</tr>
</table>
You can achieve the required alignment in the cells using CSS properties: text-align:center and text-align:left. By the way, a row defaults to text-align:left so if you don't put the alignment then it by default goes to left alignment.
And for merging the cells, you can use rowspan and colspan attribute in the tag inside HTML.
I am posting a working example with complete CSS and HTML code for your consideration here: https://jsfiddle.net/rahuldhangar/0s5usofv/
HTML code:
<table width="400" cellspacing="0" cellpadding="0" border="0" style="background:#EEE;font:small-caps 400 14px sans-serif;color:#444;">
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="middle" align="center" width="125" bgcolor="#DDDDDD">Logo Here</td>
<td style="line-height:1.6;padding: 5px 15px;">
<div>Name Here, Position Title</div>
<div>Company Name</div>
<div>Stress address wrapped around here</div>
<div>Desk: 123.456.789 | Cell: 123.456.789</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding: 5px;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td align="center">
<ul style="list-style:none;margin:0;padding:0;">
<li style="display:inline-block;padding:0 5px;"> Icon </li>
<li style="display:inline-block;padding:0 5px;"> Icon </li>
<li style="display:inline-block;padding:0 5px;"> Icon </li>
<li style="display:inline-block;padding:0 5px;"> Icon </li>
<li style="display:inline-block;padding:0 5px;"> Icon </li>
</ul>
</td>
</tr>
<tr>
<td align="center">
A Certified B Corporation <sup>®</sup>
</td>
</tr>
</table>
</td>
I am trying to create an html email newsletter and achieving this look.
So far I have the two images in one table and each image is in it's own table data.
<table align="center">
<tr>
<td width="250" bgcolor="#ffffff">
<img src="PickYourSale-wrinkles-v2.jpg" width="249" height="249">
</td>
<td width="250" bgcolor="#ffffff">
<img src="PickYourSale-NEW-v2.jpg" width="249" height="249">
</td>
</tr>
</table>
I am trying to figure out how I can get the call to action button exactly like in this image. Anyone know how?
jsfiddle - https://jsfiddle.net/sd128bbv/
You can easily achieve this with CSS and adding an extra row for buttons.
Take a look at this snippet.
table#newletter {
font-family: sans-serif;
}
tr.buttons {
text-align: center;
}
a.button {
padding: 10px;
border-radius: 4px;
background: indigo;
color: white;
font-weight: bold;
text-decoration: underline;
}
<table id="newsletter" align="center">
<tr>
<td width="250" bgcolor="#ffffff">
<img src="http://cdn2-www.thefashionspot.com/assets/uploads/gallery/earth-day-beauty-awards-2015/john-masters-organics-sea-mist-sea-salt-spray.jpg" width="249" height="249">
</td>
<td width="250" bgcolor="#ffffff">
<img src="http://healthfulmama.com/wp-content/uploads/2012/03/bottles.jpg" width="249" height="249">
</td>
</tr>
<tr class="buttons">
<td><a class="button" href="http://www.google.com" title="Sample button link">Clickie ></a>
</td>
<td><a class="button" href="http://www.google.com" title="Sample button link">Clickie ></a>
</td>
</tr>
</table>
Yoy can try this way
<table align="center">
<tr>
<td width="250" bgcolor="#ffffff">
<img src="PickYourSale-wrinkles-v2.jpg" width="249" height="249" alt="example">
</td>
<td width="250" bgcolor="#ffffff">
<img src="PickYourSale-NEW-v2.jpg" width="249" height="249" alt="example">
</td>
</tr>
<tr>
<td width="250" style = "text-align:center">
<button>click me</button>
</td>
<td width="250" style = "text-align:center">
<button>click me</button>
</td>
</tr>
</table>
Is it possible to use element after hover effect
I tried like this
.tableclass tr td:hover a{
color:#fff;
}
what i am trying to do that when i hover the td so then anchor link inside that td should change its color to white..
here is how i tried my self but not working for me?
.GridAlternate td:hover a , .GridRowStyle td:hover a{
color:#fff;
}
My GridView HTML
<table cellspacing="0" border="1" style="border-collapse:collapse;" id="GV_Users" rules="rows" class="DefaultGridStyle">
<tbody><tr class="GridHeader">
<th scope="col">User Name</th><th scope="col">Role Name</th><th valign="middle" align="left" style="width:22%;" scope="col">LogIn</th><th valign="middle" align="center" style="width:33%;" scope="col">Action</th>
</tr><tr class="GridRowStyle">
<td>
Ali Nisarr
</td><td>
Admin
</td><td valign="middle" align="left">
alinisar#ken.com
</td><td valign="middle" align="center">
Edit
Remove
Disable
</td>
</tr><tr class="GridAlternate">
<td>
Nizam Ullah
</td><td>
Admin
</td><td valign="middle" align="left">
nizam#ken.com
</td><td valign="middle" align="center">
Edit
Remove
Disable
</td>
</tr><tr>
<td colspan="4">
<table class="GridPager">
<tbody><tr>
<td width="7%">
Showing
:
</td>
<td width="5%">
<span id="lbl_rowstartindex">1</span>
-
</td>
<td>
<span id="lbl_rowendindex">2</span>
</td>
<td>
of
</td>
<td>
<span id="lbl_totalrecords">2</span>
</td>
<td width="50%" align="center">
</td>
<td width="18%" align="right">
Displaying per page:
</td>
<td align="left">
<input type="text" id="TxBx_PageSize" maxlength="3" value="10" name="ctl00$CPH_Content$TC_SysUsers$TP_Users$GV_Users$ctl05$TxBx_PageSize">
</td>
<td align="left">
Change
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
Am i doing something wrong or is there any other approach i should follow?
try this;
tr.GridAlternate td:hover a , tr.GridRowStyle td:hover a{
color:#fff;
}
And make sure to insert this at the end of the style sheet. Maybe it is being override by other class.
I hope this helps
http://codepen.io/princemaple/pen/Dcxdi
It's totally working for me.
I assume some of your rules are wrongly cascaded?
Like you have more specific targeting rules overrides this rule...
Why dont you try
.tableclass td:hover a {
color:#fff;
}
I am trying to place an iframe in an area that depicts rounded borders. In an effort to do this, I'm using an HTML table. My content displays as I want, but there is a white bar above and below the iframe. I'm not sure why this is happening. Here is my code:
<table border="0" cellpadding="0" cellspacing="0" style="width:640px;">
<tr>
<td style="height:12px; width:12px; vertical-align:top; background-color:white; font-size:6pt;"><img alt="" src="c1.png" style="width:12px; height:12px; vertical-align:top;" /></td>
<td class="height:12px; vertical-align:top;"><div style="background-color:silver; height:12x;"> </div></td>
<td style="height:12px; width:12px; vertical-align:top; background-color:white; font-size:8pt;"><img alt="" src="c2.png" style="width:12px; height:12px; vertical-align:top;" /></td>
</tr>
<tr>
<td style="background-color:silver; font-size:6pt;"> </td>
<td style="background-color:silver; font-size:6pt;"><iframe id="myIframe" frameborder="0" style="border:0px; overflow:visible; width:100%;" width="100%" src="/Test.aspx" scrolling="no"></iframe></td>
<td style="background-color:silver; font-size:6pt;"> </td>
</tr>
<tr>
<td style="background-color:silver; font-size:6pt;"><img alt="" src="c3.png"
style="width:12px; height:12px; vertical-align:bottom;" /></td>
<td style="background-color:silver; font-size:6pt;"> </td>
<td style="background-color:silver; font-size:6pt;"><img alt="" src="c4.png"
style="width:12px; height:12px; vertical-align:bottom;" /></td>
</tr>
</table>
Can somebody tell me how to get rid of the white bars? Thanks!
I think the problem is that in your middle cell, your "text" (the non-breaking space) is taller than the row height should be.
Also, you have one class attribute instead of style.
Would this simplified code work for you? If I understand correctly what your intention is...
<table style="border-collapse: collapse; width:640px;" cellpadding="0">
<tr>
<td style="background-color: silver; height:12px; width:12px;"><img alt="" src="c1.png" style="width:12px; height:12px;" /></td>
<td style="background-color: silver; height:12px;"></td>
<td style="background-color: silver; height:12px; width:12px;"><img alt="" src="c2.png" style="width:12px; height:12px;" /></td>
</tr>
<tr>
<td style="background-color: silver;"></td>
<td style="background-color: silver;"><iframe id="myIframe" style="border: none; overflow:visible; width:100%;" src="/Test.aspx" scrolling="no"></iframe></td>
<td style="background-color: silver;"></td>
</tr>
<tr>
<td style="background-color: silver; height:12px; width:12px;"><img alt="" src="c3.png" style="width:12px; height:12px;" /></td>
<td style="background-color: silver; height:12px;"></td>
<td style="background-color: silver; height:12px; width:12px;"><img alt="" src="c4.png" style="width:12px; height:12px;" /></td>
</tr>
</table>
I recommend using Firebug in Firefox (or the "Elements" developer tool in Chrome) to inspect your html elements and see which element is occupying that space. It's also helpful for questions like these if you could list what browser(s) show the issue. It's probably better suited to doctype.com as well.
<label id="hhaaaa" for='<%= hh.ClientID %>'>
<table style="height: 100px; width: 300px;cursor: pointer" cellpadding="0" cellspacing="0" id="jhuu" onmouseover="Highlight(this.id,true,'ss');" onmouseout="Highlight(this.id,false,'ss');" class="asdqweqwe">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" style="height: 10px">
</td>
</tr>
<tr>
<td valign="top" style="width: 20px; padding-left: 5px; padding-top: 7px"><input id="hh" runat="server" type="checkbox" /></td>
<td style="width: 60px" valign="top" align="center"><img src="" /></td>
<td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" onclick="" style="cursor: pointer" src="" /></span><br /><span></span></td>
</tr>
<tr>
<td colspan="3" style="height: 10px">
</td>
</tr>
</table>
</td>
</tr>
</table>
</label>
Hello i write this code to make a check box label this code run in all Browser Except Firefox ???!!!!
The Label can't contain the element it's labeling, it's simply wrong.
(Thanks erKURITA :))
Try something like this first and see if it works fine:
<label id="hhaaaa" for="<%= hh.ClientID %>">Some description here..</label>
As far as I know Label is an inline element so to have it contain other elements add display: block; CSS to it although it's not very elegant and probably against standards.
I think this line is the problem:
<td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" onclick="" style="cursor: pointer" src="" /></span><br /><span></span></td>
Remove the span end tag that is not open.
<td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" style="cursor: pointer" src="" /><br /><span></span></td>