bootstrap grid doesn't align the same way as a <table> - html

I'm trying to convert from table to bootstrap grid for mobile comparability. Below is an image of both of them on one page but even though they both follow the same css, bootstrap isn't at the center unlike table is. Can someone please explain this to me because this makes no sense.
Thank you
table is at the top and Bootstrap is at the bottom
and here's my HTML
.platinum2 {
color: #FFFFFF;
font-size: 30px;
font-weight: 600;
line-height: 41px;
text-align: center;
}
.package_text {
color: #FFFFFF;
font-family: "lato";
font-size: 14px;
font-weight: 500;
line-height: 26px;
}
.package_price {
color: #FFFFFF;
font-family: "lato";
font-size: 16px;
font-weight: bold;
line-height: 14px;
text-align: center;
}
.glyphicon-star{
font-size: 20px;
}
<div class="row" style="width:50%;margin-left:25% ; margin-bottom:25px; text-align:center">
<h1 class="platinum2">Platinum <br><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /> </h1>
<div class="col-md-6" >
<span class="package_text">Hand Wash<br>Full Interior<br>Complete Vacuum<br>Leather Clean+Shine<br>
<br />
Tire Dressing<br>Tire and Rim Detailing<br>Engine Shampoo<br />
<br /></span>
<span class="package_price"> Cars: $189</span>
</div>
<div class="col-md-6">
<span class="package_text">Roof Liner<br>Full Body Wax<br>Clay Bar Treatment<br>Interior Shampooing<br />
<br />
Complete Detail<br>In & Out Windows<br>Door Jam Cleaning<br />
<br /></span>
<span class="package_price">SUVs: $199</span>
</div>
</div>
</div>
<div class="container" style="background-image:url('/images/StripedBGDetailPackages.png' ); align-items:center; text-align:center; margin-top:25px; padding-top:25px; background-size:100%" >
<table style="width:50%;margin-left:25% ; margin-right:25%; margin-bottom:25px;">
<tr>
<td class="platinum2">Gold</td>
<td class="platinum2">Silver</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Complete Vacuum</td>
<td class="package_text">Clay Bar Treatment</td>
</tr>
<tr>
<td class="package_text">Interior Shampooing</td>
<td class="package_text">Complete Body Wax</td>
</tr>
<tr>
<td class="package_text">Leather Clean+Shine</td>
<td class="package_text">Tire and Rim</td>
</tr>
<tr>
<td class="package_text">Complete Deetail</td>
<td class="package_text">Detailing</td>
</tr>
<tr>
<td class="package_text">In & Out Windows</td>
<td class="package_text">Tire Dressing</td>
</tr>
<tr class="package_text">
<td> </td>
<td> </td>
</tr>
<tr>
<td class="package_price">Cars:$119 SUVs:$129</td>
<td class="package_price">Cars:$99 SUVs:$109</td>
</tr>
</table>
<div class="row" style="width:50%;margin-left:25% ; margin-right:25%; margin-bottom:25px;">
<div class="col-md-6">
<table>
<tr>
<td class="platinum2">Gold</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Complete Vacuum</td>
</tr>
<tr>
<td class="package_text">Interior Shampooing</td>
</tr>
<tr>
<td class="package_text">Leather Clean+Shine</td>
</tr>
<tr>
<td class="package_text">Complete Deetail</td>
</tr>
<tr>
<td class="package_text">In & Out Windows</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="package_price">Cars:$119 SUVs:$129</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table>
<tr>
<td class="platinum2">Silver</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Clay Bar Treatment</td>
</tr>
<tr>
<td class="package_text">Complete Body Wax</td>
</tr>
<tr><td class="package_text">Tire and Rim</td></tr>
<tr><td class="package_text">Detailing</td></tr>
<tr><td class="package_text">Tire Dressing</td></tr>
<tr><td> </td></tr>
<tr><td class="package_price">Cars:$99 SUVs:$109</td></tr>
</table>
</div>
</div>

To debug, first I added the following since your text are white, and border to everything with 1px solid red color, by doing this it is very easy to see why it is not centered! check the link
body {
background-color: gray;
}
* {
border: 1px solid red;
}
https://jsfiddle.net/dalinhuang/aLpv8k3f/4/
Now, as you can see Gold BS it is in the correct position, that's because
you need only add the following class to your <table class="fullwidth">
.fullwidth {
width: 100%;
}
OK, full solution, remove the debug stuff we added:
https://jsfiddle.net/dalinhuang/aLpv8k3f/5/
Also I think your star are not in the same line, update your .glyphicon-star to add this margin-top: -1px;.
.glyphicon-star {
font-size: 20px;
margin-top: -1px;
}

Related

how to force a page break after n amount of iterations on apex:repeat inside table (pdf visualforce)

In my pdf visualforce, I have a table which iterates over a list of records:
<apex:component controller="SaleInvoiceController" access="global">
<apex:attribute name="saleInvoicePI" assignTo="{!saleInvoiceId}" description="Sale Invoice para la Sale Invoice" type="String"/>
<apex:stylesheet value="{!URLFOR($Resource.PDF_Resources, 'css/saleInvoice.css')}"/>
<div class="header">
<p style="text-align: center;">
<b>
{!parametros.Name}<BR/>
Registered Office: {!parametros.Billing_Street__c}, {!parametros.Billing_City__c}, {!parametros.Billing_Zip_Postal_Code__c}<BR/>
Correspondence Address: {!parametros.Shipping_Street__c}, {!parametros.Shipping_City__c}, {!parametros.Shipping_Zip_Postal_Code__c}<BR/>
Telephone: {!parametros.Phone__c} FAX: {!parametros.Fax__c}<BR/>
<apex:outputText value="{!parametros.Vat__c}" rendered="{!isFoskett}" />
</b>
</p>
<p style="text-align: center;{! IF(isFoskett, 'display:none;' , '') }">
VAT: {!cuenta.CUIT__c}<BR/>
</p>
</div>
<div class="divPage" style="width: 100%;">
<table style="width: 80%;" cellpadding="0" cellspacing="0">
<tr style="height: 100px;">
<td class="tdBorder" style="width: 50%;">
<div><b>{!mainCustomer.Name}</b></div>
<div>{!mainCustomer.BillingStreet}</div>
<div>{!mainCustomer.BillingCity}</div>
<div>{!mainCustomer.BillingCountry}</div>
<div>{!mainCustomer.BillingPostalCode}</div>
</td>
<td class="tdBorder" style="width: 50%;">
<div><b>Date:</b> <apex:outputText value="{0, date, dd/MM/yyyy}"><apex:param value="{!saleInvoice.Date__c}" /></apex:outputText></div>
<div><b>Invoice No:</b> {!saleInvoice.Invoice_Nbr__c}</div>
</td>
</tr>
<tr style="height: 100px;">
<td class="tdBorder">
<div><b>PO #</b> {!soldContainer.PO__c}</div>
</td>
<td class="tdBorder">
<div><b>Transport:</b> {!saleInvoice.Vessell_name__c}</div>
<div><b>Country of Origin:</b> {!saleInvoice.origen_country_name__c}</div>
<div><b>Country of Destination:</b> {!saleInvoice.Destination_Country_name__c}</div>
</td>
</tr>
</table>
<BR/>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>Cartons</th>
<th>Description</th>
<th>Gross</th>
<th>Net</th>
<th>Price <span style="display:{!IF(saleInvoice.Euros__c, 'none', 'inline')};">US$</span><span style="display:{!IF(!saleInvoice.Euros__c, 'none', 'inline')};">€</span></th>
<th>Total <span style="display:{!IF(saleInvoice.Euros__c, 'none', 'inline')};">US$</span><span style="display:{!IF(!saleInvoice.Euros__c, 'none', 'inline')};">€</span></th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="5"></th>
<th>Total</th>
</tr>
<tr>
<th class="tdNumber"><apex:outputField value="{!saleInvoice.Total_Packs_1__c}" /></th>
<th></th>
<th class="tdNumber"><apex:outputField value="{!saleInvoice.Kgs_Total_Gross_Weight_1__c}" /></th>
<th class="tdNumber"><apex:outputField value="{!saleInvoice.Kgs_Total_Net_Weight_1__c}" /></th>
<th></th>
<th class="tdNumber">
<apex:outputField value="{!saleInvoice.Total_US__c}" rendered="{!!saleInvoice.Euros__c}" />
<apex:outputField value="{!saleInvoice.Total_Euros__c}" rendered="{!saleInvoice.Euros__c}" />
</th>
</tr>
</tfoot>
<tbody>
<apex:repeat value="{!saleItems}" var="saleItem">
<tr>
<td class="tdNumber"><apex:outputField value="{!saleItem.Packs__c}" /> </td>
<td>
<apex:outputText value="{!saleItem.Description_Another_Components__c}" rendered="{!saleItem.Another_component__c}"/>
<apex:outputText value="{!saleItem.Customaize_Description__c} " rendered="{!!saleItem.Another_component__c}"/>
</td>
<td class="tdNumber"><apex:outputField value="{!saleItem.Kgs_Gross_Weight__c}" rendered="{!!saleItem.Another_component__c}"/> </td>
<td class="tdNumber"><apex:outputField value="{!saleItem.Kgs_Net_Weight__c}" rendered="{!!saleItem.Another_component__c}"/> </td>
<td class="tdNumber">
<apex:outputField value="{!saleItem.USD_Per_Net_Ton__c}" rendered="{!!saleInvoice.Euros__c && !saleItem.Another_component__c}"/>
<apex:outputField value="{!saleItem.Per_Net_Ton__c}" rendered="{!saleInvoice.Euros__c && !saleItem.Another_component__c}"/>
</td>
<td class="tdNumber">
<apex:outputField value="{!saleItem.Total_Item_Amount__c}" rendered="{!!saleInvoice.Euros__c}"/>
<apex:outputField value="{!saleItem.Total_Item_Amount_Euros__c}" rendered="{!saleInvoice.Euros__c}"/>
</td>
</tr>
</apex:repeat>
<tr style="height: 20px;">
<td></td>
<td>{!saleInvoice.First_Payment_Percentage__c}% {!saleInvoice.First_Payment_Conditions__c} </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 20px;display:{!IF(saleInvoice.Second_Payment_Percentage__c>0, 'display', 'none')};">
<td></td>
<td>{!saleInvoice.Second_Payment_Percentage__c}% {!saleInvoice.Second_Payment_Conditions__c} </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 40px;">
<td></td>
<td>
{!saleInvoice.Price_Condition__c} <apex:outputField value="{!saleInvoice.Destination_Port_name__c}"/> <BR/>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 40px;">
<td></td>
<td>
<div style="font-weight: bold;">
Container:
</div>
{!saleInvoice.Purchased_CT_Number__c} <BR/>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 40px;">
<td></td>
<td>
Please arrange payment to our bankers:
<div style="font-weight: bold;">
<BR/>
{!saleInvoice.Bank_Information__r.Name} <BR/>
{!saleInvoice.Bank_Information__r.Beneficiary_Bank_ABA__c} <BR/>
{!saleInvoice.Bank_Information__r.Beneficiary_Bank_Address__c} <BR/>
ACCOUNT NO: {!saleInvoice.Bank_Information__r.Beneficiary_Bank_Account_Nbr__c} <BR/>
{!saleInvoice.Bank_Information__r.Beneficiary_Customer__c} <BR/>
SWIFT: {!saleInvoice.Bank_Information__r.Beneficiary_Bank_Swift_Code__c} <BR/>
IBAN: {!saleInvoice.Bank_Information__r.Beneficiary_Bank_IBAN__c} <BR/>
</div>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<br/><br/><br/>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width: 90%"> </td>
<td style="text-align: center;"><apex:image url="{!digitalSignImage}" width="200px" height="100px"/><br/>{!digitalSignText}</td>
</tr>
</table>
</div>
</apex:component>
CSS:
#page {
margin-top: 3cm;
margin-left: 1.0cm;
margin-right: 1.0cm;
margin-bottom: 0.5cm;
#top-center{
content: element(header);
}
}
* {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
table {
margin-left:auto;
margin-right:auto;
border-collapse: collapse;
}
table thead tr th {
border: 1px solid black;
text-align: center;
padding: 5px;
}
table tfoot tr th {
border: 1px solid black;
padding: 5px;
}
table tbody tr td {
border-left: 1px solid black;
border-right: 1px solid black;
padding: 5px;
}
div.header {
position: running(header);
}
.tdBorder {
border: 1px solid black;
padding: 5px;
}
.tdNumber {
text-align: right;
}
I want to only render 10 records per page.
I tried using a apex:variable, adding an output panel that renders a div with "page-break-after:always" every 10 iterations, but it affects the width of the table for some reason and the footer is rendered on the first page, and not at the bottom of the table.
Do I have to make logic on the apex side ? or is there a css or some css attributes that can help me achieve this without apex logic? Thanks!

How to prevent overflow of div content

I have a html that when the window shrinks, the content of sub divs gets cutoff. Even though the outermost div is overflow:auto, and there is a scroll bar..
I notice that overflow:hidden is set in multiple child divs. The thing is the inner html are generated from some API and it would impractical to reset all these overflow properties.
My question is:
the height/width of these child divs are not set, why the overflow property still applies?
is there another way to prevent cutoff in child div? Like making sure the parent div has enough height?
Below is a simplified version of my html:
<div id="main" style="width: 100%; height: 100%; overflow: auto; -ms-zoom: 1;" abp="1">
<div style="box-sizing:border-box">
<div style="overflow:hidden;text-align:left">
<div id="SecListA" style="width: 100%; height: 100%; overflow: hidden; position: relative;">
<div>
<span class="ttl" id="sectKey-18-HL" style="font-size: 20px; font-weight: 600;" abp="373">Section A</span>
</div>
</div>
</div>
</div>
<div style="box-sizing:border-box">
<div style="overflow:hidden;text-align:left">
<div id="SecListB" style="width: 100%; height: 100%; overflow: hidden; position: relative;">
<div>
<span class="ttl" id="sectKey-18-HL" style="font-size: 20px; font-weight: 600;" abp="373">Section B</span>
</div>
<table class="skTbl" id="MRLTable-CVIntList280">
<thead abp="416">
<tr class="visHid colHdr" abp="417">
<th class="rIndent" abp="418"></th>
<th class="hlImp" style="width: 96%;" abp="419"></th>
<th style="width: 1%;"></th>
<th style="width: 1%;"></th>
<th style="width: 1%;"></th>
<th style="width: 1%;"></th>
</tr>
</thead>
<tbody abp="424">
<tr style="display: none;" abp="425">
<td abp="426"></td>
</tr>
<tr>
<td abp="428"></td>
<td abp="429">
<div style="padding-left: 0px; display: inline-block;" abp="430"><span class="vbIcn icn icnMan" abp="431"><img src="C:\PROGRAM FILES (X86)\Y.png" abp="432"></span></div> subtitle A
</td>
<td abp="433">
<span abp="434"></span>
</td>
<td abp="435"><span abp="436"></span></td>
<td abp="437"><span class="MRLRecFldHover" abp="438"></span></td>
<td abp="439"><span class="MRLRecFldHover" abp="440"></span></td>
</tr>
<tr title="Edit this item">
<td abp="442"></td>
<td class="hlImp titleField hlImp" abp="443"><span tabindex="0"><div style="padding-left: 20px; display: inline-block;" abp="445"><span class="vbIcn icn icnMan"><img src="C:\PROGRAM FILES (X86)\X.png"></span></div> paragrah A</span>
</td>
<td abp="448"><span></span></td>
<td abp="450"><span></span></td>
<td abp="452"><span></span></td>
<td abp="454"><span><span class="itAct" abp="456"><span title="Remove this set" style="padding: 0px 24px 16px 8px; vertical-align: top;"><span class="vbIcn icn icnDelete" abp="458"></span></span>
</span>
</span>
</td>
</tr>
<tr>
<td></td>
<td colspan="5">
<table class="skForceFitTbl skTbl" cellspacing="0" cellpadding="0" abp="462">
<tbody abp="463">
<tr class="noLn" abp="464">
<td class="skForceFitCell" abp="465">
<span abp="466">
<table style="width: 100%; border-collapse: collapse; -ms-overflow-y: hidden;">
<tbody abp="468">
<tr abp="469">
<td style="padding-left: 40px;" abp="470"></td>
<td style="width: 100%; text-align: left;" abp="471">
<span style="font-family: 'Segoe UI'; font-size: 14px; font-weight: normal;">
some text for the ssdfasdfdsfffffffffffffffffffffffffffffffffffffffffffffffffffff. <br>dddddd
</span>
</td>
</tr>
</tbody>
</table>
</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="display: none;" abp="425">
<td abp="426"></td>
</tr>
<tr>
<td abp="428"></td>
<td abp="429">
<div style="padding-left: 0px; display: inline-block;" abp="430"><span class="vbIcn icn icnMan" abp="431"><img src="C:\PROGRAM FILES (X86)\Y.png" abp="432"></span></div> subtitle B
</td>
<td abp="433">
<span abp="434"></span>
</td>
<td abp="435"><span abp="436"></span></td>
<td abp="437"><span class="MRLRecFldHover" abp="438"></span></td>
<td abp="439"><span class="MRLRecFldHover" abp="440"></span></td>
</tr>
<tr title="Edit this item">
<td abp="442"></td>
<td class="hlImp titleField hlImp" abp="443"><span tabindex="0"><div style="padding-left: 20px; display: inline-block;" abp="445"><span class="vbIcn icn icnMan"><img src="C:\PROGRAM FILES (X86)\X.png"></span></div> paragrah A</span>
</td>
<td abp="448"><span></span></td>
<td abp="450"><span></span></td>
<td abp="452"><span></span></td>
<td abp="454"><span><span class="itAct" abp="456"><span title="Remove this set" style="padding: 0px 24px 16px 8px; vertical-align: top;"><span class="vbIcn icn icnDelete" abp="458"></span></span>
</span>
</span>
</td>
</tr>
<tr>
<td></td>
<td colspan="5">
<table class="skForceFitTbl skTbl" cellspacing="0" cellpadding="0" abp="462">
<tbody abp="463">
<tr class="noLn" abp="464">
<td class="skForceFitCell" abp="465">
<span abp="466">
<table style="width: 100%; border-collapse: collapse; -ms-overflow-y: hidden;">
<tbody abp="468">
<tr abp="469">
<td style="padding-left: 40px;" abp="470"></td>
<td style="width: 100%; text-align: left;" abp="471">
<span style="font-family: 'Segoe UI'; font-size: 14px; font-weight: normal;">
some text for the testing. This text will get cutoff when the window is small enough.... <br>dddddd
</span>
</td>
</tr>
</tbody>
</table>
</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr title="Edit this item">
<td abp="442"></td>
<td class="hlImp titleField hlImp" abp="443"><span tabindex="0"><div style="padding-left: 20px; display: inline-block;" abp="445"><span class="vbIcn icn icnMan"><img src="C:\PROGRAM FILES (X86)\X.png"></span></div> paragrah B</span>
</td>
<td abp="448"><span></span></td>
<td abp="450"><span></span></td>
<td abp="452"><span></span></td>
<td abp="454"><span><span class="itAct" abp="456"><span title="Remove this set" style="padding: 0px 24px 16px 8px; vertical-align: top;"><span></span></span>
</span>
</span>
</td>
</tr>
<tr>
<td></td>
<td colspan="5">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<span>
<table style="width: 100%; border-collapse: collapse; -ms-overflow-y: hidden;">
<tbody abp="468">
<tr abp="469">
<td style="padding-left: 40px;" abp="470"></td>
<td style="width: 100%; text-align: left;" abp="471">
<span style="font-family: 'Segoe UI'; font-size: 14px; font-weight: normal;">
some text for the testing. This text will get cutoff when the window is small enough.... <br>dddddd
</span>
</td>
</tr>
</tbody>
</table>
</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Thats just how overflow works. If you set it to hidden on a div, any content that flows outside of its boundaries, regardless of what makes it flow outside, it gets clipped.
Ideally the proper solution would be to change the markup. However, if you really can't, you can hack it with css using !important:
#main div {
overflow: initial !important;
}
#main {
width: initial !important;
overflow: initial !important;
}
div#SecListB {
overflow: initial !important;
}
Check out a fiddle here.
This text...
some text for the ssdfasdfdsfffffffffffffffffffffffffffffffffffffffffffffffffffff.
is most likely the cause (it appears several times). It contains one extremely long "word" which forces the table-cell which is in to be extended. But that's completely unrealistic. Use real text with real word lenghts, this will change the whole scenario.
(If you don't want to type text, just google "blindtext generator" - there are pages that generate random text for you which you can copy.)

Is it possible to wrap content dynamically?

I feel like this should be easy but I can't get it. I have a left column which can be anywhere from 20 to 2000 pixels tall. I then have a mixture of content: tables, (optionally floating div's), text and images for the rest of the page.
I want multiple rows to wrap as needed next to the side column. Then when the side column is done wrapping will consume the space. I have a sample up on JSFiddle which demonstrates the problem.
I originally thought a flex container with a left floating column would this, however it is not working.
https://jsfiddle.net/heegar/c40wf28c/
CSS
.flexContainer {
display: flex;
width: 740px;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
.blue {
background-color: blue;
min-height: 25px;
width: 240px;
}
.green {
background-color: green;
min-height: 40px;
width: 490px;
}
.yellow {
background-color: yellow;
min-height: 90px;
width: 240px;
}
.orange {
background-color: orange;
width: 240px;
min-height: 30px;
}
.red {
background-color: red;
text-align: left;
vertical-align: top;
font-size: .8em;
float: left;
width: 240px;
}
.CadetBlue {
background-color: CadetBlue;
min-height: 40px;
width: 490px;
}
.GoldenRod {
background-color: GoldenRod;
width: 240px;
min-height: 30px;
}
.layoutAuto {
table-layout: auto;
}
.DataTableWithBorder {
width: 100%;
border-collapse: collapse;
border: 1px solid black;
}
.blackback {
background-color: black;
}
HTML
<body style="width:740px;">
<div class="flexContainer">
<div class="red">
<h3 style="color:#FFFFFF; font-size:11px; background-color:#383838; padding-left:8px; margin:10px 0px 1px 0px;">Ocular History</h3>
<span style="font-weight:bold; padding-top:5px;">headaches</span>
<br />
<h3 style="color:#FFFFFF; font-size:11px; background-color:#383838; padding-left:8px; margin:10px 0px 1px 0px;">Ocular Surgical History</h3>
<span style="font-weight:bold; padding-top:5px;">corneal</span>
<br /><span style="font-weight:bold; padding-top:5px;">injection(s) of</span>
<br /><span style="font-weight:bold; padding-top:5px;">lid procedure of·ectropion repair</span>
<br /><span style="font-weight:bold; padding-top:5px;">NLD probing</span>
<br />
<h3 style="color:#FFFFFF; font-size:11px; background-color:#383838; padding-left:8px; margin:10px 0px 1px 0px;">Vitals</h3>
<span style="font-weight:bold; padding-top:5px;">Temp: 98.8 Deg Fer</span>
<br /><span style="font-weight:bold; padding-top:5px;">Pulse: a 101 bpm</span>
<br /><span style="font-weight:bold; padding-top:5px;">Blood Pressure: Sys what? Dia what?</span>
<br /><span style="font-weight:bold; padding-top:5px;">Respiratory Rate: huh? bpm</span>
<br /><span style="font-weight:bold; padding-top:5px;">Weight: 199 Lizards</span>
<br /><span style="font-weight:bold; padding-top:5px;">Height: 515 Red Ants</span>
<br /><span style="font-weight:bold; padding-top:5px;">BMI: 21.18 egg</span>
<br /><span style="font-weight:bold; padding-top:5px;">Blood Glucose Level: bgl 233 vh</span>
<br />
</div>
<div class="green">
Section 1 - should NOT auto fill to bottom of Red column
</div>
<div class="yellow">
Section 2 - should move under section 1 and to the right of the red column
</div>
<div class="orange">
Section 3 - should move next to Section 2
</div>
<div class="blue">
<h3 style="color:#FFFFFF; background-color:#383838; padding-left:8px; margin:10px 0px 0px 0px;">Hertel</h3>
<strong>Base</strong> 91mm
<br /><strong>OD</strong> 18mm <strong>OS</strong> 23mm
</div>
<div class="GoldenRod">
<h3 style="color:#FFFFFF; background-color:#383838; padding-left:8px; margin:10px 0px 0px 0px;">Amsler Grid</h3>
<table>
<tr>
<td class="BoldText top">OS</td>
<td>
<table class="amslerTable layoutFixed">
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
<td> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
<td> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
<td> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
<td> </td>
</tr>
</table>
</td>
<td class="BoldText top">OD</td>
<td>
<table class="amslerTable layoutFixed">
<tr>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="blackback"> </td>
</tr>
<tr>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
<td class="blackback"> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="green">
sample data
</div>
<div class="orange">
<h3 style="color:#FFFFFF; background-color:#383838; padding-left:8px; margin:10px 0px 0px 0px;">Visual Acuity</h3>
<table class="stripedTable DataTableWithBorder layoutFixed">
<tr class="BoldText">
<td> </td>
<td>CC</td>
<td>SC</td>
<td>PH</td>
</tr>
<tr>
<td class="BoldText">OD</td>
<td>20/25</td>
<td>20/20</td>
<td>20/15</td>
</tr>
<tr>
<td class="BoldText">OS</td>
<td>20/25</td>
<td>20/20</td>
<td>20/15</td>
</tr>
<tr>
<td class="BoldText">OU</td>
<td>20/25</td>
<td>20/20</td>
<td> </td>
</tr>
</table>
<br />Test Used: Sn
</div>
<div class="blue">
blah blah blah
</div>
<div class="CadetBlue">
<h3 style="color:#FFFFFF; background-color:#383838; padding-left:8px; margin:10px 0px 0px 0px;">Auto Refraction</h3>
<strong>Age:</strong> 299 quarter days <strong>Purpose:</strong> justa type
<table class="">
<tr>
<td class="BoldText">OD</td>
<td>-1.50</td>
<td>+0.75</td>
<td>x 11</td>
<td>VaD 20/28/10</td>
<td>VaN 20/2</td>
</tr>
<tr>
<td class="BoldText">OS</td>
<td>-3.00</td>
<td>+1.00</td>
<td>x 154</td>
<td>VaD 20/48/13</td>
<td>VaN 20/2</td>
</tr>
</table>
</div>
</div>
</body>

Aligning a table to the second column of another table

I want to align the second <table> in the <div>. The table should start from the second column of the first table. Right now, the second table with the text “1111111111111” starts from the extreme left but I wish to align it to where the textboxes start in the first table.
Here is my HTML:
<div style="float: left; height: 250px;overflow:auto; display:block;margin-left: 10px">
<table border="1">
<tr>
<td style="padding-left: 10px; font-size: 24px;text-align: center" colspan="2">Title</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">First Name</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">Email</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 45px;"></td>
<td style="text-align: center"></td>
</tr>
</table>
<table border="1">
<tr>
<td style="padding-top: 20px; word-wrap: break-word;text-align: center">1111111111111</td>
</tr>
</table>
</div>
Set the margin-left value to 33% for the 2nd table using :nth-child(2)
table:nth-child(2) {
margin-left: 33%;
}
<div style="float: left; height: 250px;overflow:auto; display:block;margin-left: 10px">
<table border="1">
<tr>
<td style="padding-left: 10px; font-size: 24px;text-align: center" colspan="2">Title</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">First Name</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">Email</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 45px;"></td>
<td style="text-align: center"></td>
</tr>
</table>
<table border="1">
<tr>
<td style="padding-top: 20px; word-wrap: break-word;text-align: center">1111111111111</td>
</tr>
</table>
</div>
div {
display: table; /* Display the div as a table */
}
div > table {
display: contents; /* Ignore the tables and display their contents
as if they were contents of the div */
}
div > table:last-child tr:before {
content: ''; /* Insert a pseudo-element at the beginning */
display: table-cell; /* Display it as a cell */
}
div {
display: table;
}
div > table {
display: contents;
}
div > table:last-child tr:before {
content: '';
display: table-cell;
}
<div>
<table border="1">
<caption>Title</caption>
<tr>
<td>First Name</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" /></td>
</tr>
</table>
<table border="1">
<tr>
<td>1111111111111</td>
</tr>
</table>
</div>
Note display: contents is not widely supported yet.
You can have a look at this code. Let me know if its working with you.
http://jsfiddle.net/FnK9D/13/
<div style="position:absolute;">
<table border="1" style="">
<tr>
<td style="padding-left: 10px; font-size: 24px;text-align: center" colspan="2">Title</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">First Name</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 10px;">
<asp:Label runat="server">Email</asp:Label>
</td>
<td style="padding-top: 10px;padding-left: 10px">
<input type="text" />
</td>
</tr>
<tr>
<td style="padding-top: 45px;"></td>
<td style="text-align: center"></td>
</tr>
</table>
<table border="1" style="float:right;">
<tr>
<td style="padding-top: 20px; word-wrap: break-word;text-align: center">1111111111111111</td>
</tr>
</table>
</div>

Using z-index in a table cell to write over an image

I want to place text on top of an image that I placed in a table cell.
I tried to use the z-index but the text keeps appearing under the image.
I created a class called p1 that positioned the image relative(not sure how I should handle this inside of a table) and the z-index -1.
I then added the class id in the table cell tag.
What I have so far:
.font1 {
font-family: Verdana, Geneva, sans-serif;
font-size: small;
text-align: left;
}
.hangingindent {
padding-left: 100px;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
}
.hangingindent2 {
padding-left: 75px;
}
.p1 {
position: relative;
z-index: -1;
}
.backbox {
z-index: -1;
position: relative;
left: 0;
right: 0;
botton: 0;
}
.text {
z-index 100;
color: #0000000;
font-size: 14px;
position: absolute;
top: 100px;
right: 200px;
overflow: hidden;
}
<table width="1013" border="0" align="center" cellpadding="0">
<tr>
<td colspan="5">
<img src="images/images2/header.gif" width="1013" height="642" />
</td>
</tr>
<tr>
<td colspan="5">
<img src="images/images2/menu-grid.gif" width="1013" height="232" />
</td>
</tr>
<tr>
<td width="55"> </td>
<td width="231">
<img src="images/images2/solutions.jpg" width="204" height="46" />
</td>
<td width="233">
<img src="images/images2/capabilities.jpg" width="204" height="46" />
</td>
<td width="232">
<img src="images/images2/art services.jpg" width="204" height="46" />
</td>
<td width="254">
<img src="images/images2/contact us.jpg" width="204" height="46" />
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5" class="hangingindent2">
<img src="images/images2/WELCOME.gif" width="500" height="100" />
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5" class="hangingindent">
<p>Since 1968, Packaging Products Corporation (PPC) has been a leader in the flexographic printing and converting industry.
<br />Our focus on emerging technologies in film substrates, ink systems, and controlled atmosphere packaging, enables us to
<br />provide the highest quality products at the most competitive prices.</p>
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5">
<div class="backbox">
<img src="images/images2/bottom2.gif" width="1013" height="810" />
<div class="text">This is a test to see where the text will land</div>
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
As I got from your question is you want to put text over an image. So to do it, there is no need to use z-index. you can do it by setting absolute position of p tag and make td tag as position relative.
demo for it is you can use the link
<table>
<tr>
<td>
<p>Hello</p>
<img src="http://www.freakypic.in/wp-content/uploads/2014/08/flower-images.jpg" />
</td>
</tr>
</table>
CSS:
img {
width:200px;
}
td {
border:2px solid red;
position:relative;
}
p {
position:absolute;
color:yellow;
font-size:30px;
top:0px;
left:70px;
}
You can change the markup little bit.!Z-index will work with position set to other than static (which is default).
Here, you can remove the <img> tag & display the image as background image.
Other solution wrap the text in <p> or <div> & make it position: absolute & immediate parent <td> as position:relative (This is mentioned earlier already)
little code explanation
exp1 -- background-image
td {
background-image: url("");
background-position: left top fixed;
}
exp1 - HTML markup
<td>Data to be there on top of the image</td>
Please check this link! - JSFIDDLE