The html table coding structure looks something like the code shown below
<table>
<tr>
<td>Text</td>
<td>input text field</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>submit butto</td>
</tr>
</table>
How to create such table structure in flex which has above given row and column format in flex application with the option of colspann and rowspan alternate too?
There are a lot of ways. I would probably start by looking into the Form layout container. That is great for a two column layout, although it gives you little control over the first column which is primarily used for
You could also, in theory, create something like this by using embedded containers, but I do not think I would recommend that approach because I suspect you'll end up with a lot of unnecessary containers.
You could also write your own layout class. More info on layouts here. This is the most powerful/flexible approach, but probably also the most time consuming.
Related
As described in this and this answers, we can use HTML tags in Markdown to create tables with cells spanning multiple rows or columns. Suppose I want to make the following table (rendered by Visual Studio Code with extension "Markdown All in One"):
Desired Effect
But the problem for the second answer is that the rowspan/colspan of the first column/row will be rendered with a additional column/row in the front, as in the following example (does not work on StackOverflow, but works in VSCode; a work-around is to add an empty column/row, as suggested by the first comment in that answer, but this is still not perfect):
||Letter|Typesetting|Result|
|-|-|-|-|
|<td rowspan=4>a |Normal|a
||Italic|*a*|
||Bold|**a**|
||Math|$a$
Result:
Table constructed using method in Answer 2
Then we can use the HTML tags, as described by the first answer:
<table>
<thead>
<tr> <th>Letter <th>Typesetting <th>Result
</thead>
<tbody>
<tr> <td rowspan=4>a <td>Normal <td>a
<tr> <td>Italic <td>*a*
<tr> <td>Bold <td>**a**
<tr> <td>Math <td>$a$
</tbody>
</table>
But then Markdown formatting will be lost:
Table constructed using method in Answer 1
Is there any way to overcome this problem, i.e. using HTML tags to achieve rowspan/colspan without loss of Markdown text formatting?
I'm trying to combine an anchor-offset with an anchor-target-style on a table-row.
Having the anchor-ID applied to the table row and styling it via 'tr:target td' does achieve the desired look, while the solutions provided here ( offsetting an html anchor to adjust for fixed header ) achieve the desired offset, but only for text.
I can't use the top-voted solution as it requires the "display: block"-attribute which is incompatible to the tr-tag as far as I know. If somehow possible I would prefer a only css/html solution
The structure I use:
<table>
<tr id="anchor-target1"> <td> Something </td> </tr>
<tr id="anchor-target2"> <td> Something </td> </tr>
</table>
Update: JSFiddle-Example. Goal is to combine both functions: https://jsfiddle.net/7rknaqwu/5/
So what is the deal with tables? Are they bad for SEO or is that just a myth? I'm creating a calendar for a company to advertise their fund-raising events. As a result, the contents of the calender need to be SEO friendly.
Is there anything wrong with using a table? Google Calendar uses a table, however, those a calendars are private and SEO doesn't enter it.
This calendar is on the front page of a website. It's a big deal. Are tables okay? Or should I try and create one with html?
I'm on bootstrap...is there an existing plugin that works well with it?
Tables are absolutely fine... so long as they are used for tabular data, not for effecting a layout!
They are great for SEO, especially if you take care to markup them up with all the semantic goodness available to you:
<table summary="Interest Rates">
<caption>Interest Rates</caption>
<thead>
<tr>
<th>Account Type</th>
<th>Interest Rate</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Recommended for you: 'Young Saver'</td>
<td>Interest from: 1.6%</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Smart</td>
<td>From 2%</td>
</tr>
<tr>
<td>Young Saver</td>
<td>From 1.6%</td>
</tr>
</tbody>
</table>
ref: http://reference.sitepoint.com/html/tfoot
Note we provide a caption to summarize the table, we demarcate the various areas with a table header, table body and table footer, and we also markup out table header cells with th, not with td for normal data cells.
I don't believe tables are bad for SEO, I don't think a specific code language or element could be bad for SEO. I would say give it a shot in divs first, as that would be the better way to do it.
This link might help you decide!
I have a table where elements can have child elements with the very same attributes, like:
ITEM ATTRIBUTE 1 ATTRIBUTE 2
item value value
sub value value
sub value value
item value value
From this I've created a markup like this:
<table>
<thead>
<tr>
<th>ITEM</th>
<th>ATTRIBUTE 1</th>
<th>ATTRIBUTE 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>item</td>
<td>value</td>
<td>value</td>
</tr>
<tr>
<td colspan=3>
<table>
<tbody>
<tr>
<td>sub</td>
<td>value</td>
<td>value</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>item</td>
<td>value</td>
<td>value</td>
</tr>
</tbody>
</table>
My questions are now:
Is this the best semantic solution?
Is another approach better suited? If so, which is the recommended way?
Is the table header in charge for both tables or do I have to create a new one (maybe with visibility: hidden for the nested table?
Is this the best semantic solution?
Not really. While the act of nesting an element A within another element B can be used to indicate that A is a child of B, that isn't what you're doing here: you're nesting the table within a completely different row, so there's no implication of a parent-child relationship between A and B.
By creating a cell that spans all the columns in the table and then building another table inside that with the same number of columns, you're also effectively saying "these are some other columns, that don't relate to the ones in the outer table".
You can see the implied (lack of) relationship between the columns by adding a border to the cells in your example above:
Obviously you can fix that with CSS, but the unstyled rendering of a piece of HTML is often a good guide to its semantics.
Is another approach better suited? If so, which is the recommended way?
There's no standard way to represent hierarchical relationships between rows of a table in HTML. Cribbing from an answer I gave to a similar question, though, you can do it with extra classes, ids and data- attributes:
<table>
<thead>
<tr>
<th>ITEM</th>
<th>ATTRIBUTE 1</th>
<th>ATTRIBUTE 2</th>
</tr>
</thead>
<tbody>
<tr id=100>
<td>item</td>
<td>value</td>
<td>value</td>
</tr>
<tr id=110 data-parent=100 class=level-1>
<td>sub</td>
<td>value</td>
<td>value</td>
</tr>
<tr id=200>
<td>item</td>
<td>value</td>
<td>value</td>
</tr>
</tbody>
</table>
The parent-child relationship won't be visible in an unstyled rendering (there's no other way you could make it so without adding extra content, as far as I can see), but there are enough hooks to add the CSS required:
.level-1 > td:first-child {
padding-left: 1em;
}
... which results in this:
With a little javascript, you could also use the id and data-parent attributes to set things up so that e.g. hovering over a row causes its parent to be highlighted.
Is the table header in charge for both tables, or do I have to create a new one?
In your proposed solution, creating a single cell that spans all columns and then building another table inside it means that there's no implied relationship between the header cells and those of your "child" row. Obviously my suggested solution above doesn't have that problem.
This is W3C's recommendation:
At the current time, those who want to ensure consistent support across Assistive
Technologies for tables where the headers are not in the first row/column may want
to use the technique for complex tables H43: Using id and headers attributes to
associate data cells with header cells in data tables. For simple tables that have
headers in the first column or row we recommend the use of the th and td elements.
you can lock at this post: Best way to construct a semantic html table
hope that will help you to get your answer
Talking about semantics requires us to have more time than to find an answer for your question.
But for a whole point, this link should help you. That page contains all the information you may be interested in. Interestingly unlike normal 'declarative' spec w3c writes, it has 'suggestive' writing about the question in this context. You may wish to read right from the start.
I think putting the children in a separate table is the wrong way to go. Nested tables are not like nested lists; they don't carry that same semantic hierarchy. It seems everything should be within the same table if it all lists the same information.
For example, if your table had the headers
REGION POPULATION AREA
then you could have item1 = Earth, item2 = France, item3 = Paris... and it wouldn't really matter if France were a child of Earth or if Paris were a child of France; you'd still be better off keeping it all in one table and not trying to do a parent/child relationship other than in CSS styling.
If your table is really not comprehensible without someone knowing that parent/child relationship, could you give an example of the table data so I can better understand how to structure it?
I created a design for my website. I am planning to make it with TABLES because it seems to be the easiest. The tables are not going the way I intended.
There was a problem putting the code on the page so I put my HTML document (.html) and the way I want it to look (.jpg) in the below zip-file link:
http://ericlounge.host22.com/000/22014/0aa.zip
If someone could give me the code or explain my error that would be great!
I would avoid using tables, but it's your choice.
<Table>
<TR>
<TD rowspan ="3">
Navigation
</TD>
<TD>
TITLE
</TD>
<TD rowspan ="3">
SideBar
</TD
</TR>
<TR>
<TD>
ADS
</TD>
</TR>
<TR>
<TD>
Content
</TD>
</TR>
</Table>
This does not answer your question, however, it will give you reasons why you should look at a different approach for your layout/design rather than tables.
Why not use tables for layout in HTML?
To counteract the "tables is the easiest" option then have a look at Yahoo's YUI templates and examples. These can probably produce exactly what you are after with little effort.
http://developer.yahoo.com/yui/grids/