Convert table into mobile responsive format using media query - html

<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!

Related

Replicate an UI template

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>

responsive column is going below other column

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

Taking HTML and changing to CSS to override plugin

I have the code for HTML and the developer of the plugin said to create a file which I have to change some of the wording the customer sees. I found the code in HTML (via firebug) and put it in the form but its not working so I am think I need to change more of it into CSS. This is what I have so far but again it didn't change anything.
I just want the wording to change instead of unlimited content just unlimited etc.
Thank you for any help.
<div class="fee-options-for-category">
<table class="fee-options">
<thead>
<tr>
</thead>
<tbody>
<tr class="fee-option fee-id-1">
<td class="fee-selection">
<input id="wpbdp-fees-radio-1" type="radio" data-canrecur="0" checked="checked" value="1" name="fees[91]">
</td>
<td class="fee-label">
<label for="wpbdp-fees-radio-1">Basic Listing</label>
</td>
<td class="fee-amount"> — </td>
<td class="fee-duration"> Unlimited </td>
<td class="fee-images"> 0 </td>
</tr>
<tr class="fee-description fee-id-1">
<td></td>
<td colspan="4">✓ put as much a you want.</td>
</tr>
<tr class="fee-option fee-id-2">
<td class="fee-selection">
<input id="wpbdp-fees-radio-2" type="radio" data-canrecur="1" value="2" name="fees[91]">
</td>
<td class="fee-label">
<label for="wpbdp-fees-radio-2">Featured Listing</label>
</td>
<td class="fee-amount"> $ 12.95 </td>
<td class="fee-duration"> 365 days </td>
<td class="fee-images"> 5 </td>
</tr>
<tr class="fee-description fee-id-2">
<td></td>
<td colspan="4">
✓ Unlimited content .
<br>
✓ Ratings support.
<br>
✓ Ability to attach files to your listing.
</td>
</tr>
</tbody>
</table>
</div>
thank you in advance
Susan

HTML Table Manipulation(multiple rows/cols in one <tr> or <td>)

I am making a form for inserting recipes to my database, whenever im dealing with forms, i always go for simplicity -> tables.
For example i have this code:
<table>
<tr>
<td>
<tr>Text:</tr>
<tr>
<input type="button" />
</tr>
</td>
<td>
<input type="text" />
</td>
</tr>
</table>
I wanted to have 2 rows inside a column, The above code doesnt actually work, im just demonstrating on how i would like it to arrange.
Is there anyway to do this? or do i have to resort to using divs and CSS(ugghh,, i hate this part. trial and error on the location.....)
<table>
<tr>
<td>
<table>
<tr>
<td>Text:</td>
</tr>
<tr>
<td><input type="button" /></td>
</tr>
</table>
</td>
<td>
<input type="text" />
</td>
</tr>

Table padding doesn't work in IE

i have a table that consists of two rows, the second row is a table, which i want it's elements to be centered to the main table, so my code is as follows:
<TABLE>
<TBODY>
<TR>
<TD>
<DIV id=gform:scan_area>
<OBJECT></OBJECT>
</DIV>
</TD>
</TR>
<TR>
<TD>
<TABLE style="PADDING-LEFT: 300px"> // works in firefox but doesn't work in ie9
<TBODY>
<TR>
<TD>
<INPUT>
</TD>
<TD>
<SPAN></SPAN>
</TD>
<TD>
<INPUT>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
ISSUE: TABLE style="PADDING-LEFT: 300px" works fine in firefox but doesn't work in IE9 (Quirks mode), please advise how to fix this issue or if you have any other ideas.
I think your code is not written well enough, it was much better if you used "colspan" for solving this issue.
Any way, I tried to change your code in a way that centralize the second table in the first table:
<TABLE>
<TBODY>
<TR>
<TD>
<DIV id='gform:scan_area'>
<OBJECT></OBJECT>
</DIV>
</TD>
</TR>
<TR>
<TD>
<TABLE style="width:60%">
<TBODY>
<TR>
<TD style="width:20%;padding-right:160px;">
<INPUT>
</TD>
<TD style="width:20%">
<SPAN></SPAN>
</TD>
<TD style="width:20%">
<INPUT>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
You need to do it this way
<div style="padding-left: 300px;">
<table>
...
</table>
</div>
For more read this answer: Padding table with CSS doesn't work on IE
Table padding is only applied to cells. By adding it to the <td> you will see it work in IE9 and Firefox. See: W3schools: Tables
<TABLE> // works in firefox but doesn't work in ie9
<TBODY>
<TR>
<TD style="PADDING-LEFT: 300px">
<INPUT>
</TD>
<TD >
<SPAN></SPAN>
</TD>
<TD>
<INPUT>
</TD>
</TR>
</TBODY>
</TABLE>