You need to sign in to do that
Don't have an account?
Heather_Hanson
Help with lining up tables and making them the same size
Hello, I'm working on a visualforce page and I can't seem to get my tables to line up the way I want them to. I've had some success, but am just having trouble finishing it off.
I need it to look like this:
But so far I have only managed to make it look like this:
Here is the HTML
And the CSS is
I need it to look like this:
But so far I have only managed to make it look like this:
Here is the HTML
<table class="Cx" width="98.7%"> <tr><td class="tac rPad" colspan="4"><strong>Telco Info</strong></td></tr> <tr><td class="tar rPad">Sales Order:</td><td>company name</td></tr> <tr><td class="tar rPad">Sales Rep:</td><td>Rebiller Group</td><td>TN:</td><td>1-800-555-5555</td></tr> <tr><td class="tar rPad">E-Mail:</td><td>ao@ao.ca</td></tr> <tr><td class="tar rPad">Original E-Mail:</td><td>ao@selectcomtelecom.ca</td></tr> <tr><td class="tar rPad">Original Fax:</td><td>555-555-5555</td></tr> </table> <br/> <div width="98.7%" class="col-container"> <table class="Cx col" > <th><strong>Activty</strong></th> <tr><td>x</td><td>New</td><td>TF</td></tr> <tr><td>Add</td><td>Disc</td></tr> <tr><td>Change</td></tr> <tr><td>Seasonal Disc</td></tr> <tr><td>Reconnect Date</td></tr> </table> <table class="Cx col" > <th><strong>Service Type</strong></th> <tr><td>Service</td></tr> <tr><td>Cross Border-MCI</td></tr> <tr><td>Cross Border-AT&T</td></tr> <tr><td>Other</td></tr> <tr><td><strong>Mass Calling</strong></td></tr> <tr><td>Yes</td><td>x</td><td>No</td></tr> </table> <table> <tr><td> <table width="100%" class="Cx col"> <tr><td><strong>Dates</strong></td></tr> <tr><td>Application Date:</td> <td><apex:outputText value="{0,date,yyyy-MM-dd}"><apex:param value="{!Client_Line__c.LASTMODIFIEDDATE}" /></apex:outputText></td> </tr> <tr><td>Due Date: ??</td><td>what is the merge field?</td></tr> </table> <table width="100%" class="Cx col"> <tr><td><strong>Reference of Calls</strong></td></tr> <tr><td>Yes</td><td>x</td><td>No</td></tr> <tr><td>Refer Calls To</td></tr> </table> </td> </tr> </table> </div>
And the CSS is
.Cx{ border: 1px solid #534e43; } .tac{ text-align: center; } .tar{ text-align: right; } .tal{ text-align: left; } .rPad{ padding-right: 10px; } .col-container { display: table; width: 98.7%; } .col { display: table-cell; padding: 16px; }Any help would be appreciated! Been struggling with this for awhile now.
BTW, I would suggest using Ligthing Design System CSS. (https://www.lightningdesignsystem.com/utilities/sizing/) instead of add inline style attributes.
Thanks for the help...and the tip on the Lightning Design System!!
I tried your code though and it didn't seem to work. I had tried doing doing the tables within a table too and couldn't get it to work, but below is what happens when I copy/paste the code you gave me.
Do you have any other suggestions? I took what you gave me and broke it down to just two tables within the main table and stripped all CSS and width and they still appear one on top of the other.