I'm want to add new row using jquery any one help me to solve my problem"
'''
https://jsfiddle.net/dn6chabs/86/
jsfiddle here want to add new row
'''
So, there were quite a few issues with your code:
If you check console by hitting f12 you have this error Uncaught ReferenceError: $c is not defined because of this line: $("#field7").val($c);
I don't think it's necessary for the add and remove to be <a> tags, unless you want them specifically for styling, as it confuses the matter
$(this).parent().parent().remove(); this line doesn't really appear to do anything
Anyway, here's the corrected code!
$("#field7").val(c);, this has been corrected
The add and remove have been made <span> tags with custom styling to look like <a> tags
The onclick event has been corrected in light of this
The removal process has been fixed and is now $('#table').children().eq($("#table").children().length - 1).not('tfoot').remove();, whereby it never removes the subtotal / total line
$(document).ready(function() {
$("#add_to_table").on('click', function() {
navObj = $("#table tbody:last").clone();
$("#table").append(navObj);
});
$("#remove_from_table").on('click', function() {
$('#table').children().eq($("#table").children().length - 1).not('tfoot').remove();
});
});
$(document).ready(function() {
var a = document.getElementById("field5").innerHTML;
var b = document.getElementById("field6").InnerHTML;
c = a * b;
$("#field7").val(c);
});
.link {
text-decoration: underline;
color: blue;
cursor: pointer;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<span id="add_to_table" class="link">Add</span>
<span id="remove_from_table" class="link">Remove</span>
<table id="table" style="width: 100%; border-collapse: collapse; border-spacing: 0; margin-bottom: 20px; border: 0px;" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr id="row">
<th scope="row" style="white-space: nowrap; font-weight: 400; color: #fff; font-size: 1.6em; background: #3989c6;">#</th>
<th scope="row" class="text-left" style="white-space: nowrap; font-weight: 400; color: #fff; font-size: 1.6em; background: #3989c6;">DESCRIPTION</th>
<th scope="row" class="text-right" style="white-space: nowrap; font-weight: 400; color: #fff; font-size: 1.6em; background: #3989c6;">UNITS</th>
<th scope="row" class="text-right" style="white-space: nowrap; font-weight: 400; color: #fff; font-size: 1.6em; background: #3989c6;">PRICE</th>
<th scope="row" class="text-right" style="white-space: nowrap; font-weight: 400; color: #fff; font-size: 1.6em; background: #3989c6;">TOTAL</th>
</tr>
</thead>
<tbody>
<tr>
<td id="field1" class="no" style="color: #fff; font-size: 1.6em; background: #3989c6;">01</td>
<td id="field2" class="text-left" style="padding: 15px; background: #eee; border-bottom: 1px solid #fff;">
<h3 id="field3">WebSite <em><strong>Consultansy</strong></em></h3>
<em id="field4">Tasks related to meeting minutes AbC</em>
</td>
<td id="field5" class="qty" style="padding: 15px; background: #eee; border-bottom: 1px solid #fff;">4</td>
<td id="field6" class="unit" style="background: #ddd;">$100.00</td>
<td id="field7" class="total" style="background: #3989c6; color: #fff;">$300.00</td>
<td>
</td>
</tr>
</tbody>
<tfoot style="display: table-footer-group; vertical-align: middle; border-color: inherit;">
<tr>
<td style="border: none;" colspan="2"> </td>
<td style="background: 0 0; border-bottom: none; white-space: nowrap; text-align: right; padding: 10px 20px; font-size: 1.2em; border-top: 1px solid #aaa;" colspan="2">SUBTOTAL</td>
<td style="background: 0 0; border-bottom: none; white-space: nowrap; text-align: right; padding: 10px 20px; font-size: 1.2em; border-top: 1px solid #aaa;">$300.00</td>
</tr>
<tr>
<td style="border: none;" colspan="2"> </td>
<td style="background: 0 0; border-bottom: none; white-space: nowrap; text-align: right; padding: 10px 20px; font-size: 1.2em; border-top: 1px solid #aaa;" colspan="2"><em>TAX Deductions</em></td>
<td style="background: 0 0; border-bottom: none; white-space: nowrap; text-align: right; padding: 10px 20px; font-size: 1.2em; border-top: 1px solid #aaa;">00.00</td>
</tr>
<tr>
<td style="border: none;" colspan="2"> </td>
<td style="color: #3989c6; font-size: 1.4em; border-top: 1px solid #3989c6;" colspan="2">GRAND TOTAL</td>
<td style="color: #3989c6; font-size: 1.4em; border-top: 1px solid #3989c6;">$300.00</td>
</tr>
</tfoot>
</table>
Check the fiddle: JSFiddle
Let me know how you get on!
I am having issues with certain styles not showing correctly in browsers for tables that I created. Specifically the class I created .rowB background color not showing as well as the right side border that I created for class cellBrdrRght.
#charset "UTF-8";
/* CSS Document */
/* info charts */
td{
vertical-align: middle;
}
.chartHeader{
background-color: #115967!important;
color: #fff;
text-align: center;
font-weight: bold;
}
.rowA{
background-color: #d0d0d0!important;
color: #4b4b4b;
.rowB{
background-color: #666666!important;
color: #fff;
}
.cellBrdrRght {
border-style: solid!important;
border-width: 0px 1px 0px 0px!important;
border-color: white!important;
}
.cellnoBrd {
border-style: none;
}
.tableFooter{
font-size: 10px;
border-style: none;
background-color: #115967!important;
color: #fff;
text-align: left;
colspan: 3;
a:sideBar {
background-color: #115967!important;
padding: 25px 50px 75px 100px;
color: #fff;
}
<link href="http://benefitsatbenefitelect.com/new/wp-content/styles/other-styles.css" rel="stylesheet" type="text/css">
<div style="overflow-x: auto;">
<table>
<tbody>
<tr class="chartHeader">
<td class="cellBrdrRght">Plan Benefits</td>
<td class="cellnoBrd" colspan="2">Current Benefits</td>
</tr>
<tr class="rowA">
<td class="cellBrdrRght">Description</td>
<td class="cellBrdrRght">PPO</td>
<td class="cellnoBrd">HDHP</td>
</tr>
<tr class="rowB">
<td class="cellBrdrRght" style="text-align:left;"><b>Deductible</b> In/Out-of-Network & 2x Family</td>
<td class="cellBrdrRght">$1,250/$2,250**</td>
<td class="cellnoBrd">$3,000/$6,000**</td>
</tr>
<tr class="rowA">
<td class="cellBrdrRght" style="text-align:left;"><b>Coinsurance</b> In/Out-of-Network</td>
<td class="cellBrdrRght">Alaska Plan 20%/20%<br> Non-Alaska Plan 20%/40%</td>
<td class="cellnoBrd">Alaska Plan 20%/20%<br> Non-Alaska Plan 20%/40%</td>
</tr>
<tr class="rowB">
<td class="cellBrdrRght" style="text-align:left;"><b>Out-of-Pocket Maximum</b> In/Out-of-Network & 2x Family</td>
<td class="cellBrdrRght">$5,000/$10,000</td>
<td class="cellnoBrd">$5,000/$10,000</td>
</tr>
<tr class="rowA">
<td class="cellBrdrRght" style="text-align:left;"><b>Primary/Specialist Office</b></td>
<td class="cellBrdrRght">$30 PCP/$40 Specialist</td>
<td class="cellnoBrd">Alaska Plan*: PCP 20%/20% Specialist 20%/20%<br> Non-Alaska Plan*: PCP 20%/40% Specialist 20%/40%</td>
</tr>
<tr class="rowB">
<td class="cellBrdrRght" style="text-align:left;"><b>Retail Prescriptions</b>Generic/Preferred/Non-Preferred</td>
<td class="cellBrdrRght">$20/$45/$60</td>
<td class="cellnoBrd">20%*</td>
</tr>
<tr class="tableFooter">
<td colspan="3">*After Deductible is met **Individuals in Family Tier need only meet individual deductible vs. family deductible</td>
</tr>
</tbody>
</table>
<hr/>
</div>
web page:
http://benefitsatbenefitelect.com/new/index.php/portfolio-item/dark-places/
css file:
http://benefitsatbenefitelect.com/new/wp-content/styles/other-styles.css
#charset "UTF-8";
/* CSS Document */
/* info charts */
td{
vertical-align: middle;
}
.chartHeader{
background-color: #115967 !important;
color: #fff;
text-align: center;
font-weight: bold;
}
.rowA{
background-color: #d0d0d0 !important;
color: #4b4b4b;
}
.rowB{
background-color: #666666 !important;
color: #fff;
}
.cellBrdrRght {
border-style: solid !important;
border-width: 0px 1px 0px 0px !important;
border-color: white !important;
}
.cellnoBrd {
border-style: none;
}
.tableFooter{
font-size: 10px;
border-style: none;
background-color: #115967 !important;
color: #fff;
text-align: left;
colspan: 3;
}
a:sideBar {
background-color: #115967 !important;
padding: 25px 50px 75px 100px;
color: #fff;
}
Change this your .rowA & .tableFooter is not closed properly in {}...
You missed closing tags in .rowA:
.rowA{
background-color: #d0d0d0!important;
color: #4b4b4b;
}
and in .tableFooter:
.tableFooter{
font-size: 10px;
border-style: none;
background-color: #115967!important;
color: #fff;
text-align: left;
colspan: 3;
}
Try this and it should properly work
I am facing an issue with a button set in a table cell which covers two rows. it does not fill the second row. how can i make this button fill both rows? I have tried to set height in the style of the button as well as on the table cell itself without success. Please see my code is below:
1) the css style of the button:
.button {
padding: 5px 15px;
font-size: 1.1em;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 1px;
box-shadow: 0 2px #999;
width: 100%;
vertical-align: middle;
}
And 2) my html table below:
<tr>
<td rowspan="2">
<button href="#0" class="button" id="cancel_order">Aκύρωση</button>
</td>
<td style="padding-right:5px; padding-left:5px;" colspan="2">
<button class="button">Εκτύπωση</button>
</td>
<td rowspan="2">
<button class="button">Παραγγελία</button>
</td>
</tr>
<tr>
<td style="padding-right:5px; padding-left:5px;" colspan="2">
<button class="button">Απόδειξη</button>
</td>
</tr>
In my opinion you should use css3 flexbox to achieve this as shown below:
.btn-holder {
display: flex;
}
.btn-holder .btn-holder {
flex-direction: column;
}
.button {
margin: 0 5px 5px 0;
padding: 5px 15px;
font-size: 1.1em;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 1px;
box-shadow: 0 2px #999;
}
<div class="btn-holder">
<button class="button" id="cancel_order">Aκύρωση</button>
<div class="btn-holder">
<button class="button">Εκτύπωση</button>
<button class="button">Παραγγελία</button>
</div>
<button class="button">Απόδειξη</button>
</div>
https://jsfiddle.net/k5wefqz5/1/
Is this your expected result ?
You miss <table> tag to complete your code.
Add this:
button {height:100%; }
Wrap table elements inside a <table> in order to get <td> and <tr> to behave as expected.
SNIPPET
table {
border: 1px solid red;
}
td {
border: 1px solid black;
}
button {
height: 100%;
}
<table>
<tr>
<td rowspan="2">
<button href="#0" class="button" id="cancel_order">Aκύρωση</button>
</td>
<td style="padding-right:5px; padding-left:5px;" colspan="2">
<button class="button">Εκτύπωση</button>
</td>
<td rowspan="2">
<button class="button">Παραγγελία</button>
</td>
</tr>
<tr>
<td style="padding-right:5px; padding-left:5px;" colspan="2">
<button class="button">Απόδειξη</button>
</td>
</tr>
</table>
I have an issue with HTML/CSS rendering in Outlook 2010.
The below HTML renders correctly in all other email clients I have tested (Thunderbird, Outlook 2003, iPhone, various webmail based products), and in various browsers too. But in Outlook 2010 I get a border around the table caption that is the same colour as the background for the tag below it.
<!DOCTYPE html>
<html>
<body>
<div style="padding: 0.3em">
<p>Here is a nice background from St Pancras Station with the Olympic Rings in the background</p>
<hr />
<table style=" width: auto; color: #000; border: 1px solid #000; border-collapse: collapse; background: #FFF;">
<caption style=" font-style: italic; text-align: left; color: #000; background: #FFF;">Files attached to this message</caption>
<tr>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Filename</th>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Size</th>
</tr>
<tr>
<td style="border: 1px solid #000; padding: 0.3em; text-align: left; vertical-align: top; width: 75%;">6315755363_7fbe95fc66_o.jpg</td>
<td style="border: 1px solid #000; padding: 0.3em; text-align: left; vertical-align: top; width: 25%;">5 MB</td>
</tr>
</table>
<p>Please click here to download the attachments.</p>
<p>The attachments are available until: <b>Tuesday, 11 December.</b></p>
<hr />
</div>
</body>
</html>
Can anyone suggest a fix for this issue?
EDIT
If you want to debug this you can save the HTML in a file and load it into Word 2010 as it uses the same rendering engine.
Try adding phantom row after <caption>
<caption style=" font-style: italic; text-align: left; color: #000; background: #FFF;">Files attached to this message</caption>
<tr style="background:#FFF; display:none;"></tr> <!--phantom row-->
<tr>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Filename</th>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Size</th>
</tr>
<!DOCTYPE html>
<html>
<body>
<div style="padding: 0.3em">
<p>Here is a nice background from St Pancras Station with the Olympic Rings in the background</p>
<hr />
<table style=" width: auto; color: #000; border-collapse: collapse;">
<tr>
<td style="border: 1px solid #fff; border-bottom-color: #000; background: #fff; text-align: left; vertical-align: top;">
<caption style=" font-style: italic; text-align: left; color: #000;">Files attached to this message</caption>
</td>
</tr>
<tr>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Filename</th>
<th style="border: 1px solid #000; padding: 0.3em; background: #ddd; text-align: left; vertical-align: top;">Size</th>
</tr>
<tr>
<td style="border: 1px solid #000; padding: 0.3em; text-align: left; vertical-align: top; width: 75%;background: #FFF;">6315755363_7fbe95fc66_o.jpg</td>
<td style="border: 1px solid #000; padding: 0.3em; text-align: left; vertical-align: top; width: 25%;background: #FFF;">5 MB</td>
</tr>
</table>
<p>Please click here to download the attachments.</p>
<p>The attachments are available until: <b>Tuesday, 11 December.</b></p>
<hr />
</div>
</body>
</html>
I've got a popup window that looks like this
Now I want to top part where the color is green and it says "Sök efter ärende" to strech all the way of the window so that the X that is used to close the window is right at the very right. I tried setting colspan to a larger value but that did not work. Do you have any idea what I could do? This is my HTML for the window
<div class="popup" id="popupF"
style="display: none;" >
<table width="100%" border="0" cellspacing="0" cellpadding="2"
align="center" class="TB_nb">
<tr>
<td colspan="3" class="pusher TB_nb"><h2>Sök efter ärende</h2>
</td>
<td><a href="javascript:void(0)"
onclick="document.getElementById('popupF').style.display = 'none';">X</a>
</td>
</tr>
</table>
<br>
<br>
<h2 class="pusher">Sök efter ärende</h2>
<div id="FVsok">
<div
style="text-align: right; width: 100%; padding-right: 5%; padding-top: 5px;">
<span
onClick="getElementById('FsokF').style.display='', getElementById('FbottomA').style.display='none', getElementById('FbottomV').style.display='', getElementById('FVsok').style.display='none'"
class="link_sm">Visa sökformulär</span>
</div>
</div>
<div id="FsokF">
<div
style="text-align: right; width: 100%; padding-right: 5%; padding-top: 5px;; padding-bottom: 5px;">
<span
onClick="getElementById('FsokF').style.display='none', getElementById('FbottomA').style.display='none', getElementById('FbottomV').style.display='', getElementById('FVsok').style.display=''"
class="link_sm">Dölj sökformulär</span>
</div>
<div style="width: 100%; margin-left: 15px; margin-right: 80px;"
class="fontS80">
<div class="fl30"> Sök efter ärende</div>
<div class="clear"></div>
<div class="fl30">
<input type="text" size="60"
name="searchArende">
</div>
<div class="clear"></div>
<div class="fl30">
<input type="button" value="Avbryt">
</div>
<div class="fl10">
<input type="button" value=" Sök "
onclick="javascript:doSubmit('Arendesokning', 'search')">
</div>
<div class="clear"> </div>
</div>
</div>
<div style="width: 100%; margin-left: 15px; margin-right: 15px;">
<table width="100%" border="0" cellspacing="0" cellpadding="4"
align="center">
<tr>
<td><h3>Sökresultat:</h3>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="4">En massa text <span class="link">Hjälp!</span>
</td>
</tr>
<tr>
<td><input type="button" value="Visa alla">
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="smallb">
<td>Antal ärenden: 0</td>
<td> </td>
<td>Visa ärenden: <a class="link"
href="javascript:doSubmit('MenyNavigation', 'REW_includes/fullfoljd_fran_sok.jsp')">
</a> <a class="link"
href="javascript:doSubmit('MenyNavigation', 'FWD_includes/fullfoljd_fran_sok.jsp')">
</a></td>
<td> </td>
</tr>
</table>
<table width="100%" cellspacing="0" align="center" class="sortable"
id="unique_id">
<tr>
<th class="thkant">Ärende</th>
<th class="thkant">Ingivningsdag</th>
<th class="thkant">Sökande1</th>
<th class="thkant">Uppfinnare1</th>
<th class="thkant">Ombud1</th>
<!--
<th class="thkant">Region</th>
<th class="thkant">Land</th>
<th class="thkant">Telefonnummer</th>-->
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr class="g2"
onmouseover="javascript:setStoreStyle(this)"
; onmouseout="javascript:getStoreStyle(this)"
onclick="javascript:goToOversikt('','','','','','')"
style="cursor: pointer;">
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<div id="FbottomV">
<table width="100%" align="center">
<tr>
<td align="left"><input type="button" id="visaknapp"
value="Visa" disabled style="width: 150px;"
onClick="getElementById('sokR').style.display='', getElementById('bottomA').style.display='', getElementById('bottomV').style.display='none', getElementById('Vsok').style.display='', getElementById('sokF').style.display='none'">
</td>
<td align="right"><input type="button" value="Avbryt"
style="width: 150px;" class="checkmargin"><input
type="button" value="Infoga" disabled style="width: 150px;">
</td>
</tr>
</table>
</div>
<div id="FbottomA" style="display: none">
<table width="100%" align="center">
<tr>
<td align="left"><input type="button"
value="Ändra i register" style="width: 150px;">
</td>
<td align="right"><input type="button" value="Avbryt"
style="width: 150px;" class="checkmargin"><input
type="button" value="Infoga" style="width: 150px;">
</td>
</tr>
</table>
</div>
</div>
</div>
And this is the CSS
* {font-family:arial;}
.avnamn{
color: #90002b;
font-size: 140%;
display: inline;
vertical-align: 3%;
margin-left: 1%;
}
.b{border:1px solid #000;}
.readonly{background-color: #CCC;}
.Webdings{
font-family: Webdings;
}
ul{margin-top: 0px}
.mt3{margin-top:-3px;}
.mt5p{margin-top:5px;}
.fontS80 {font-size: 80%;}
a:link{color:#000; text-decoration:none; }
a:visited{color:#000; text-decoration:none; }
a:hover{color:#000; text-decoration:none; }
a:active{color:#000; text-decoration:none; }
.fontS75 {font-size: 75%;}
.link{color: #003366;
text-decoration: underline;
cursor: pointer;
font-weight: bold;}
.link_sm{color: #003366;
text-decoration: underline;
cursor: pointer;}
.link_sm{font-size: 70%;cursor: pointer;}
.small{font-size: 75%;}
.smallg{font-size: 75%;
color: #555;}
.ssmall{
font-size: 65%;
font-weight: bold;
color: #555;
}
.small60{font-size: 60%;}
.small50{
font-size: 50%;
color: #333;
}
.smallb{font-size: 85%;}
table{display:inline;}
h1{font-size: 130%;display:inline;}
h2{font-size: 100%;display:inline;}
h3{
font-size: 80%;
display:inline;
font-family: "Arial Unicode MS", Arial, Helvetica, sans-serif;
}
h4{font-size: 70%;display:inline;}
h5{
font-size: 80%;
display:inline;
font-family: "Arial Unicode MS", Arial, Helvetica, sans-serif;
}
.hthin{
font-size: 125%;
}
.th {text-align: left;}
td, th{font-size: 75%;
vertical-align: text-top;}
.td_link{cursor: pointer;}
.td40{height:40px;}
.td60{height:60px;}
.thkant{
border-top: 1px solid #000;
border-bottom: 1px solid #000;
font-size: 70%;
text-align: left;
}
.labb{F0F0E3; c1c1b3 }
.bb{border-bottom: 1px solid #000;}
.bbV{border-bottom: 1px solid #FFF;}
.TB_nbA {background-color:#CCC;}
.TB_bt, .TB_nb, .TB_db, .TB_bb {background-color:#efefdc;}
.hk {background-color:#d9ddb3;}
.hknot {background-color:#f9faf2;}
/*<!--F8F8F1-->*/
.TB_bt{border-top: 1px solid #FFF;}
.TB_bt5{border-top: 5px solid #FFF;}
.TB_bb{border-bottom: 1px solid #999;}
.TB_bb2{border-bottom: 2px solid #c1c1b3;}
.TB_db{border-bottom: 1px solid #000; border-top: 1px solid #000;}
.TB_tb{border-top: 2px solid #efefdc;}
.TB_bo{border: 2px solid #efefdc;}
.TB_bo_hk{border-top: 1px solid #efefdc;}
.TB_bo2{border: 1px solid #efefdc;}
.TB_bo2B{
border-top: 2px solid #c1c1b3;
border-left: 3px solid #efefdc;
border-right: 3px solid #efefdc;
border-bottom: 2px solid #c1c1b3;
}
.TD_bo{
border-right: 1px solid #c1c1b3;
width: 9%;
font-size: 70%;
text-align: center;
}
.TD_bo2{
border-right: 0;
width: 9%;
font-size: 70%;
text-align: center;
}
.ytb{
border-left:3px solid #efefdc;
border-right:3px solid #efefdc;
}
.datum {
font-size: 70%;
padding-right: 5px;
vertical-align: text-top;}
.sub {background:#EAEAEA;}
.sub_meny, .sub_meny_r, .sub_meny_active, .sub_meny_sm{
font-size: 70%;
padding-left: 20px;
padding-right: 20px;
vertical-align: text-top;}
.sub_meny_sm {
font-size: 60%;
vertical-align: middle;
padding-left: 10px;
padding-right: 10px;
}
.sub_meny_r{
float:right;
font-size: 70%;
padding-left: 8px;
padding-right: 8px;}
.sub_meny_rm{margin-top:4px;}
.sub_meny_active{font-weight: bold;}
.flikkant1 {
background-image: url(../images/fl1k.jpg);
background-position: center;
z-index: -1;}
.inl_namn{
font-weight: bold;
font-size: 70%;
color: Black;
text-decoration: none;}
.th{text-align: left;}
.tr{text-align: right;}
.g1{
background-color: #FFF;
line-height: 20px;
}
.g2{
background-color: #EEE;
line-height: 20px;
}
.g3{
background-color: #DCDCDC;
line-height: 20px;
font-weight: bold;
font-size: 100%;
}
.g4{
background-color: #CCC;
line-height: 20px;
}
.popup{
border-color: #000;
border-style: groove;
border-width: 2px;
padding: 0px;
background-color: #FFF;
font-size: 70%;
}
.popuphandlaggare{
border-color: #000;
border-style: groove;
border-width: 2px;
padding: 0px;
background-color: #FFF;
font-size: 70%;
position: absolute;
top: 900px;
}
.popupN{
background-color: #F0F0E3;
color: #000;
width: 100%;
display: inline;
font-weight: bold;
height: auto;
padding: 2px;
border-bottom: 1px solid #000;
}
.pin{padding: 6px;}
.fl10, .fl20, .fl30, .fl40, .fl50, .fl60, .fl70, .fl80, .fl90, .fl100 {
padding-bottom:4px;color: #000000;
}
.over{
background-color: #EFEFDC;
line-height: 20px;
}
.half{
line-height:50%;
}
.quarter{
line-height:25%;
}
.lh10{
line-height:10%;
}
.checkmargin {margin-right: 25px;}
.checkmarginL {margin-left: 25px;}
.pusher {padding-left: 15px;"}
.pusherR {margin-right: 40px;"}
.rand3{background-color: #FFF; line-height: 3px;}
.rand1{background-color: #FFF; line-height: 1px;}
.whiteborder { color: #ffffff; border: 4px solid #ffffff; padding: 10px; margin: 10px; }
#details { width: 700; color: #ffffff; }
.column1 { color: #000000; margin: 0; padding: 0; width: 600px; border:0; float: left; }
.column2 { color: #000000;margin: 0; padding: 0; border:0; width: 80px; float: right; }
.f200 {
color: #000000;
}
.f210 {
color: #000000;float: left;
}
.f220 {
width: 400;
}
.f1450 {
width: 600;
float:left;
}
.f1550 {
width: 150;
float:left;
padding:15px;
}
.paddedcell {
padding:15px;
}
.b2{border:2px solid #efefdc;}
.inp_sel{width: 80%;}
.fl21{float:left; padding:5px; margin:5px; width:150px;} .fl455{float:left; padding:5px; margin:5px; width:120px;}
.form-bg {
background: #eeefdf;
width:1000px;
overflow:hidden;
}
.form-bg2 {
background: #eeefdf;
width:100%;
overflow:hidden;
}
.data-bar {
border-bottom:1px solid #fbfbf7;
display:inline-block;
padding:10px 10px;
}
.left {
float:left;
width:200px;
}
.discount {
float:right;
width:500px;
}
.discounts {
width:900px;
}
.right {
float:right;
width:700px;
}
.yta20 {
background: #eeefdf;
width:1100px;
}
.yta2 {
width:1100px;
}
.data-box {
width:650px;
height:100px;
border:1px solid #cbcbcb;
}
#table td {
margin:120px;
}
#personName { float:left; width:300px; } #otherDetails { float:right; width:450px; }
.th_rad_sort {border-bottom: 2px solid #000000; text-decoration: none;"}
a img { border: 0; outline:0;}
.horizontal-gradient2 {
background: #1a2adb; /* Old browsers */
background: -moz-linear-gradient(left, #1a2adb 0%, #a1e6ed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1a2adb), color-stop(100%,#a1e6ed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* IE10+ */
background: linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1a2adb', endColorstr='#a1e6ed',GradientType=1 ); /* IE6-9 */
color: white;
width: 1015px;
}
.f { float: right; color: white; }
.handlaggare { width: 1000px; }
div.data-box-nat{
margin-bottom: 10px;
border: 2px solid gray;
width: 600px;
}
div.data-box-pct{
margin-bottom: 10px;
border: 2px solid gray;
width: 600px;
}
.newpopup {
z-index:100;
position: absolute;
top:50%;
left:50%;
background-color:#ffffff; //not working
}
Change the top (troublesome) table to div:
<div id="topBar">
<span class="pusher TB_nb"><h2>Sök efter ärende</h2></span>
<span id="close">
X
</span>
</div>
Then add this css:
#topBar {width:100%; background-color:#EFEFDC;}
#close {position:absolute; right:5px;}
Heres an example: http://jsfiddle.net/FSra3/
On a side note, you really should not be using tables. Tables are for tabular data only, not to be used for layout.
Hey now add some code add your first table as like this
replace this code of your first table
<table width="100%" border="0" cellspacing="0" cellpadding="2"
align="center" class="TB_nb" style="display:table;">
<tr>
<td width="75%" class="pusher TB_nb"><h2>Sök efter ärende</h2>
</td>
<td width="25%" style="text-align:right;"><a href="javascript:void(0)"
onclick="document.getElementById('popupF').style.display = 'none';">X</a>
</td>
</tr>
</table>
Live demo
Just in case you still want to use table. In css file, you make display style of table as inline table{display:inline;} This makes the table shrink to fit its content. Use this instead: table{display:block;}