I'm working on some HTML code for which I was given a UI. I tried to do most to make it look as close as possible. But I'm stuck with the header and line spacing pieces. Here is my code:
<div>
Hello, Alice! Here are your appointments for the day:
</div>
<div style="font-style:italic">
**All times are Arizona Time**
</div>
<table style="border:1px solid #e9e9e9">
<thead bgcolor="#8c8c8c" style="border-bottom:1px solid #e9e9e9; padding:none !important">
<tr>
<th style="width:auto">10:00AM - 10:30AM (30 MIN)</th>
<th style="width:auto; float:right">Abc</th>
</tr>
</thead>
<tbody>
<tr>
<td><div style="line-height:2em">
Topic:</div></td>
<td><div>Resume Review</div></td>
</tr>
<tr>
<td><div style="line-height:2em">Phone:</div></td>
<td>1234567890</td>
</tr>
<tr>
<td><div style="line-height:2em">Email:</div></td>
<td>abc#gmail.com</td>
</tr>
<tr>
<td><div style="line-height:2em">Student notes:</div></td>
<td>Hello,
My resume is pretty ugly, I built it based on what I learned in TAPS in military out-processing.
I will be standing by for the phone call, I missed my last one because I mixed up the appointment time zone.</td>
</tr>
</tbody>
</table>
Note: I need to use the inline styling, I can't use external CSS in my system.
Here is the UI provided:
How can I match the UI and also make it responsive?
Instead of using table for header, you can use div.
Check the below code.
<div>
Hello, Alice! Here are your appointments for the day:
</div>
<div style="font-style:italic">
**All times are Arizona Time**
</div>
<div style="border: 1px solid black">
<div style="width:100%; background-color:#8c8c8c; height:20px; display:flex;justify-content:space-between;align-items:center">
<p>10:00AM - 10:30AM (30 mins)</p>
<p>Data</p>
</div>
<table>
<tbody>
<tr>
<td>
<div style="line-height:2em">
Topic:</div>
</td>
<td>
<div>Resume Review</div>
</td>
</tr>
<tr>
<td>
<div style="line-height:2em">Phone:</div>
</td>
<td>1234567890</td>
</tr>
<tr>
<td>
<div style="line-height:2em">Email:</div>
</td>
<td>abc#gmail.com</td>
</tr>
<tr>
<td>
<div style="line-height:2em">Student notes:</div>
</td>
<td>Hello, My resume is pretty ugly, I built it based on what I learned in TAPS in military out-processing. I will be standing by for the phone call, I missed my last one because I mixed up the appointment time zone.</td>
</tr>
</tbody>
</table>
</div>
Related
I have been working a lot on 2 columns inside of a table with the foundation framework. I cannot understand why column 2 is going down under column 1, when I resize my window to under 600px? I would like that the columns are staying beside each other, when the window is resized. I have set the column to fill 6 each, so the second column should not jump down?
Does anybody knows how I can solve this? The code is for email newsletter, that is why I am using tables.
I have a JSfiddle with the CSS code aswell: jsfiddle
<body>
<table class="body">
<tr>
<td class="center" align="center" valign="top">
<center>
<table class="row footer">
<tr>
<td class="wrapper">
<table class="six columns">
<tr>
<td class="left-text-pad">
<h5>Column 1</h5>
<table>
<tr>
<td>
A content text 1
</td>
</tr>
</table>
<h5>A Headline</h5>
<table>
<tr>
<td>
A content text 2
</td>
</tr>
</table>
<h5>A Headline</h5>
<table>
<tr>
<td>
A content text 3
</td>
</tr>
</table>
</td>
<td class="expander"></td>
</tr>
</table>
</td>
<td class="wrapper">
<table class="six columns">
<tr>
<td class="left-text-pad">
<h5>Column 2</h5>
<table>
<tr>
<td>
A content text 1
</td>
</tr>
</table>
<h5>A Headline</h5>
<table>
<tr>
<td>
A content text 2
</td>
</tr>
</table>
<h5>A Headline</h5>
<table>
<tr>
<td>
A big text to test if the text is responsive.
</td>
</tr>
</table>
</td>
<td class="expander"></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
Above first wrapper class there is a tag.So write style inside tr tag like
As of this writing, there is still use of the nested table layout for most email clients. The answer for this is simple: Not all clients are up to speed, not all computers are up to speed.
Using tables in html emails is the most practiced and best method for overall deployment regardless of your email client. Foundation is nice, yes - but it is not the email industry standard as of yet.
Take a look at this handy tutorial from Mailchimp. I just wanted to clarify that you are not wrong for doing it this way, and you will be better off learning responsive email coding from the aforementioned tutorials first.
All that being said - what you've done in your jsfiddle is actually correct. But if you do NOT want them to collapse, simply remove the #media query strings.
Add "float: left" to the second wrapper of column2
I'm trying to set up my website with an image, then under that image there will be two SVG files and two Bootstrap-style grids each containing one table of information. However, Bootstrap seems to be making them orient vertically instead of horizontally. You can see the end result here if you scroll to the bottom. As you'll see, the Population by Gender and Household and Family tables are one after another vertically instead of horizontally, as I want them to be. Please do note before voting to close this for duplicate that there are other problems similar to this one, but I've tried the solutions in them and they didn't work.
I've included code of the relevant portion of the HTML, it's a bit of a mess but as you can see the <div class="col-xl-6"> tags that Bootstrap uses are around the two tables, yet they still show up vertically. How come?
<div class="container-fluid">
<svg>HUGE SVG LINK REMOVED</svg>
<svg>2ND HUGE SVG LINK REMOVED</svg>
<div class="row">
<div class="col-xl-6">
<h3>Population by Gender</h3>
<div>Male: 627 (44.91%, )</div>
<div>Females: 769 (55.09%, )</div>
<br>
<table cellpadding="0">
<tr>
<td align="center">Block Group 970500-1</td>
<td>
<div>Male: 44.91%</div>
<div> Female: 55.09%</div>
</td>
</tr>
<tr>
<td align="center">New York</td>
<td>
<div id="pt" >Male: 48.39%</div>
Female: 51.61%
</td>
</tr>
<tr></tr>
</table>
<p class="small">*Based on 2010 data.</p>
</div>
<div class="col-xl-6">
<a name="HouseholdandFamily"></a>
<h3>Household and Family</h3>
<table class="tbb tbright" cellpadding="20">
<tr bgcolor="#eeeeee">
<td> </td>
<td><b>Block Group 970500-1</b></td>
</tr>
<tr>
<td>Total Households</td>
<td>548</td>
</tr>
<tr bgcolor="#eeeeee">
<td>Average Household Size</td>
<td>2.31,</td>
</tr>
<tr>
<td>1 Person Households</td>
<td>185, 33.76%, </td>
</tr>
<tr bgcolor="#eeeeee">
<td>2 or More Person Households</td>
<td>363, 66.24%, </td>
</tr>
<tr>
<td>Family Households (Families)</td>
<td>321, 58.58%, </td>
</tr>
<tr bgcolor="#eeeeee">
<td>Average Family Size</td>
<td>2.98, </td>
</tr>
<tr>
<td>Married-Couple Family</td>
<td>221, 40.33%, </td>
</tr>
<tr bgcolor="#eeeeee">
<td>Nonfamily Households</td>
<td>227, 41.42%, </td>
</tr>
</table>
</div>
</div>
You're using <div class="col-xl-6">, that means this div would take 6 columns on extra large displays, but it will take full width on anything smaller.
So, you probably need to use something smaller like this:
<div class="col-md-6"></div>
or
<div class="col-lg-6"></div>
For 'Population by Gender' box: move <table> into <div> element.
For each of div element set class col-xs-6 col-md-6.
Here you can find examples: http://getbootstrap.com/examples/grid/
i have a problem by open an html table to word.
I have a complex designed table, with table into tables-cells and so on. And now I need this table with the cell background-colors and the given borders in MS-Word.
<table class="tablebox">
<tr class="head">
<td class="cell10">Icon</td>
<td class="cell10">Status</td>
<td class="cell50">
<table class="group">
<tr class="colGroup">
<td>
<table class="box yellow">
<tr class="color">
<td class="leftbox"></td>
<td class="rightbox">6</td>
</tr>
</table>
</td>
<td>
<table class="box red">
<tr class="color">
<td class="leftbox"></td>
<td class="rightbox">12</td>
</tr>
</table>
</td>
<td>
<table class="box green">
<tr class="color">
<td class="leftbox"></td>
<td class="rightbox">7</td>
</tr>
</table>
</td>
<td>
<table class="box blue">
<tr class="color blue">
<td class="leftbox"></td>
<td class="rightbox">7</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class="cell30">Maßnahmen</td>
</tr>
<tr class="sub">
<td colspan="4">
<table>
<tr class="colGroup">
<td>
<table class="box yellow">
<tr class="color yellow">
<td class="leftbox"></td>
<td class="rightbox">6</td>
</tr>
</table>
</td>
<td>
<table class="box red">
<tr class="color red">
<td class="leftbox"></td>
<td class="rightbox">12</td>
</tr>
</table>
</td>
<td>
<table class="box green">
<tr class="color green">
<td class="leftbox"></td>
<td class="rightbox">7</td>
</tr>
</table>
</td>
<td>
<table class="box blue">
<tr class="color blue">
<td class="leftbox"></td>
<td class="rightbox">7</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
http://jsfiddle.net/ndxp5h12/8/
But when i open the document with word my css-style is gone. The most of my cells an tables don't have a border, and the background color is gone too?
When i remove the element styling (table, th etc.) then the border are ok, but the color's doesn't show in Word.
Where is the problem? How can I fix my stylesheet or how can i structure my table? Is there a common way?
Which element or class override another in Word? Or what should I not do that word read the CSS correct?
Thank you
Felix
You may have to add all of your styles within style attributes on your individual tables and cells.
For example:
<table style="background-color:green">
<tr>
<td style="*leftbox styles*"></td>
<td style="*rightbox styles*">7</td>
</tr>
</table>
This maybe can help:
go to "insert" tab, click "object" button (it's on the right)
choose "OpenDocument Text" which will open a new embedded word document
copy and paste your code from Visual Studio / Eclipse inside this embedded word page
save and close
How do you display code snippets in MS Word preserving format and syntax highlighting?
Unfortunately Word has issues with many different HTML/CSS tags, so I'm afraid it's a case of trial and error. When it comes to dt and dd you could replicate the formatting you want by using CSS classes and then applying them to suitable HTML alternatives.
<div id="horizontalContainerTile">
<div id="horizontalContainerTile_1">
<table class="horizontalContainerTable">
<tbody>
<tr>
<td id="horizontalTile0">
<div id="genericFormTile">
<div id="genericFormTile_0">
<table class="layout" id="genericFormTable">
<tbody>
<tr id="distributorId">
<td class="formFieldLabel" id="formCellLeft">Comfort Stylist ID:</td>
<td id="leftLabel"></td>
<td class="formField" id="formCellRight">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
<td id="horizontalTile1">
<div id="genericFormTile">
<div id="genericFormTile_1">
<table class="layout" id="genericFormTable">
<tbody>
<tr id="individualFirstName">
<td class="formFieldLabel" id="formCellLeft">First Name:</td>
<td id="leftLabel"></td>
<td class="formField" id="formCellRight">
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="resultsPerPage" value="100"><!-- check if the value for field comes from bundle --><input
type="hidden" name="pageNumber" value="1">
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Currently this produce a format like this:
Comfort Stylist ID: <textbox> First Name: <textbox>
And what I want on mobile device is:
Comfort Stylist ID: <textbox>
First Name: <textbox>
Please tell me, if I can do this using media query.
And I am not able to post my existing CSS code, I hope that will not be the issue.
I found it's solution and this we can achieve simply by changing your #media query CSS.
table,tbody,td{
display:block;
}
And other for positions or styling elements you can apply different CSS.
Thanks All!
I'm trying to solve a problem: it's a HTML exercise in which I must write the HTML code for a table with this design:
But I can't seem to set it straight, here's my code:
<table border>
<tr>
<td rowspan="2" colspan="2"> Batatas </td>
<td rowspan="3" colspan="2"> Couves </td>
<td> Alhos </td>
<td> Cebolas </td>
</tr>
<tr>
<td rowspan="2" colspan="2"> Alface </td>
</tr>
<tr>
<td colspan="2"> Nabos </td>
</tr>
</table>
And here's the result:
Shouldn't the rowspan="2" in the first "td" tag make the first cell larger (in height)?
What am I doing wrong?
Try this online tool here: http://html-tables.com/
and you will see how the 3 rows collapse to 2 rows visually if you are using just cell merging.
I think you need to nest tables to achieve that effect.
Actually the problem you are facing is not because of your code it is because of general rules of html table rendering, this arises because of merging of table cells
To resolve this drawback of <table> tag, I'll recommend to use <div> tag as better approach.
Try this....
<table border>
<tr>
<td rowspan="2" colspan="1"> Batatas </td>
<td rowspan="3" colspan="1"> Couves </td>
<td rowspan="1" colspan="1"> Alhos </td>
<td rowspan="1" colspan="1"> Cebolas </td>
</tr>
<tr>
<td rowspan="1" colspan="2"> Alface </td>
</tr>
<tr rowspan="1" colspan="2">
<td> Nabos </td>
</tr>
</table>
Update
As I've noticed, this can't be done using <table> tag, You can use the div approach. These div tag are able to generate your layout.
I just finished working on your problem, and I've just solved your problem using <div> tag, Have a look
<div style=" background-color: powderblue;border:1px solid black; width:410px; height:310px">
<div style="float:left;">
<div style="border:1px solid black; width:100px; float:none; height:200px">Batatas
</div>
<div style="border:1px solid black; width:100px; float:none; height:99px">Nabos
</div>
</div>
<div>
<div style="border:1px solid black;width:100px; float:left; height:301px">Couves
</div>
<div style="border:1px solid black;width:100px; float:left; height:100px">Alhos
</div>
<div style="border:1px solid black;width:100px; float:left; height:100px">Cebolas
</div>
<div style="border:1px solid black;width:202px; float:left; height:199px">Alface
</div>
</div>
</div>
Good question. The closest I got (without getting crazy with nested tables) is simply this:
<table border>
<tr>
<td colspan="2"> Batatas </td>
<td rowspan="3" colspan="2"> Couves </td>
<td> Alhos </td>
<td> Cebolas </td>
</tr>
<tr>
<td colspan="2"></td>
<td rowspan="2" colspan="2"> Alface </td>
</tr>
<tr>
<td colspan="2"> Nabos </td>
</tr>
</table>
If this doesn't work for you (and you don't want to get into complex nested html tables), then I the common belief seems to be to move away from html tables to using CSS. Obviously with CSS/divs you have much more control.