For a school assignment I have to revamp a website. I've been trying to make a table to include an image and buttons beside the image. I have the table set so the image (if you think of this an excel spreadsheet) is in A1, and A1 is as tall as B1, B2, and B3. So I want to have the large cell for the image and 3 cells, or rows rather, beside that to use as buttons.
I can't figure out how to do this, is it possible?
If I'm getting right what you are trying to achieve, I guess you should include rowspan attribute in one of the td tags (A1 cell).
<table border="1">
<tr>
<td rowspan="3">Picture Here</td>
<td>Button1</td>
</tr>
<tr>
<td>Button2</td>
</tr>
<tr>
<td>Button3</td>
</tr>
</table>
Looks like you need to read up on the 'rowspan' attribute for <table>
Related
I just started using Cypress for test automation to see if I like it but I running into a small problem. I want to assert the content of a cell based on a value in another cell in the same row. In the example below the first row contains a user that has finished registering, the cells are all filled. On the second row a new account is visible which has not yet been completed by the user. Cells such as first name and last name are still empty. Display: -
Now I want to verify that the first cell of the row containing 'usermanagementtest#test.com' in the third column contains '-'. There is no way for me to know on what row this will be displayed.
I start by asserting there is a cell visible containing the given email address:
cy.get('.module-user--list tr').find('td').contains('usermanagementtest#lukkien.com').should('be.visible')
but now I would like to assert the value of the first column on that same row.
<tbody>
<tr>
<td>John</td>
<td>Doe</td>
<td>j.doe#test.com</td>
<td>0321654987</td>
</tr>
<tr>
<td>-</td>
<td>-</td>
<td>usermanagementtest#test.com</td>
<td>-</td>
</tr>
</tbody>
With the help of a colleague I achieved this by:
cy.get('.module-user--list tr').find('td').contains('usermanagementtest#test.com').prev().prev().should('contain', '-')
Another way would be to get the parent element and find your way from there:
cy.get('.module-user--list tr').find('td').contains('usermanagementtest#test.com').parent().as('row')
cy.get('#row').find('td:nth-child(1)').should('contain', 'foo')
I have an email message that the width of a table is being respected in all email clients except outlook (surprise).
The table should be shrinking everything under the picture header and above the picture footer to 90% like shown in this codepen:
https://codepen.io/jwestqualtrics/pen/dmWPKx
In outlook, it is not being set to 90% as shown in the below picture
Here is the portion of the code is not working.
<table align="center" border="0" cellpadding="0" cellspacing="0" class="deviceWidth" width="90%">
Where the width = 90% is the part that is not working. See the whole code in the codepen. Thanks for your help.
I need to automate the store a row's text on selenium IDE. The row is not always the same. The row to be stored is the unique which contains a radiobutton selected.
The path for the button is (where 'x' is an integer variable):
//table[#id='wttrAddressees']/tbody/tr[x]/td[2]/input
I can find the selected button with:
//input[#checked='checked']
or
//input[#checked]
This works, but is not dynamic:
<tr>
<td>storeText</td>
<td>//table[#id='wttrAddressees']/tbody/tr[2]</td>
<td>rowText</td>
</tr>
Is there a way to store the xpath (not a node) of a given webElement?
Thanks,
PS - The test is all in html code.
You can find the target row dynamically by selected radio button as follows :
//table[#id='wttrAddressees']/tbody/tr[td/input[#checked='checked']]
The XPath should return <tr> element where <td> child element has child <input> element checked.
Guys please bear with me here, I've started using this blog to learn visual basics, I seriously want to learn and so far it been helping me a lot. Thank You everyone...
Now my question goes like this:.
Saying I have data in the SQL Server 2005 database and I want to retrieve data from the SQL table and display it on the textbox or listbox. I want to select Faculty_ID,Faculty_Name,F_Description from Faculty table and display these data on the textbox or listbox. And let's say I have my connection working just fine, I just need a statement to retrieve data from SQL table and display it on the textbox.
How do I do that? Please bear in mind you're helping the most stupiest, dumbest guy ever.
Thank You in Advanced!!!!!.
Repeaters are usually used to display data. Below is an example of a repeater. On the back end you can bind it to a list. I'd suggest making your own data structure and then binding it to that. By binding I mean, repeaterID.Datasource = yourDataObject and then repeaterID.Databind
<asp:Repeater ID="fieldList" runat="server">
<HeaderTemplate>
<table border="1" width="75%">
<tr>
<th>
<b>Object Field 1</b>
</th>
<th>
<b>Object Field 2</b>
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr id='<%#Eval("") %>'>
<td>
<asp:Label ID="obj1" runat="server" Text='<%# Eval("SQLObjectFieldRelName1") %>'></asp:Label>
</td>
<td>
<asp:Label ID="obj2" runat="server" Text='<%# Eval("SQLObjectFieldRelName2") %>'></asp:Label>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Text boxes and list boxes going to be less commonly used for any dataset. You'd only really use them for a string or some text. If that's what you want to do then I'd manufacturer your string in your code behind and set your textbox text to it.
I created an HTML for email marketing. I placed a table, and applied a border around it:
<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid #982676; margin:0 16px;">
For some reason I am getting 1 pixel extra white space inside when I test it in OUTLOOK 2010. I see it around images that are aligned to the top and to the left, and I see it around other cells that have a solid background color.
See image at this link:screenshot
The top triangle is an image in a cell by itself. The bottom rectangle is a cell with a background color. These were supposes to stick to the border. This is a recurring problem. Has anyone encountered this issue before?
Campaign monitor has a really great solution on how to solve this type of problem. Simple add this style code to your table elements. The code below solved my problem (same as OP) on Outlook 2010
<table align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;"> ... </table>
EDIT: Links have been replaced with wayback machine since both are gone. I also included a gif of the Email on acid version.
http://www.campaignmonitor.com/blog/post/3694/removing-spacing-from-around-tables-in-outlook-2007-and-2010
If that doesn't work, try this.
http://www.emailonacid.com/blog/details/C13/removing_unwanted_spacing_or_gaps_between_tables_in_outlook_2007_2010
I found this here:
http://www.emailonacid.com/blog/details/C13/7_tips_and_tricks_regarding_margins_and_padding_in_html_emails
" Table element margins and padding in Outlook 2007 and 2010 can cause issues
If you add margin or padding properties to your TABLE element, it will add that same margin and padding to every nested TD in Outlook 2007 and 2010. Cellpadding and cellspacing attributes are safe but it's best to avoid CSS margins and padding within the containing TABLE element."
So I guess your margin on the table could be causing this.I m not sure.
In case you haven't found a solution to this problem yet:
Make sure you set border="0" for those images within the table cells.
Add border-collapse:collapse; to the table style.
I solved this problem going into the table properties section and then clicking on "Options". Once the options box appears, change the default cell margins for Left and Right to 0" and then click OK.
For borders of 1 and 3 pixel width, the right border has a 1 pixel space behind it. One solution for this (weird...) kind of problem is a "ghost table" behind the current table, with the width of the current table minus 1 and border of 1.
For example:
<!--[if mso]><table border="1" width="699">
<tr style="display:none;"><td> </td></tr>
</table><![endif]-->
Good luck...