Is there a way to colspan a table header with GitHub flavored markdown? - html-table

HTML allows extending a table's header row across multiple columns using colspan:
<table>
<tr><th colspan=2>Logical Operators</th></tr>
<tr><td>&&</td><td>Logical and</td></tr>
<tr><td>||</td><td>Logical or</td></tr>
<tr><td>!</td><td>Logical not</td></tr>
<tr><td>? :</td><td>Logical ternary</td></tr>
</table>
On GitHub, when this HTML is rendered in a readme.md file it looks like this:
...but using markdown syntax to create a table, I can't span the table's header row across columns, e.g. I can only split up the header text:
| Logical | Operators |
|:---:| --- |
| `&&` | Logical and |
| `\|\|` | Logical or |
| `!` | Logical not |
| `? :` | Logical ternary |
...and rendering the GFM table on GitHub looks like:
I tried emulating this solution for using colspan in the table's data rows, but I could not get it to work with the header row. Is there a way to span the GFM table's header row across more than one column with GitHub flavored Markdown?
I've posted the question to the folks at the GH MD repo.

I did it this way in order to generate a table with 5 columns with headers spanning respectively over 3 and 2 columns:
<table>
<tr>
<td colspan=3>a <td colspan=2>b
<tr>
<td colspan=1>col1 <td colspan=1>col2 <td colspan=1>col3<td colspan=1>col4 <td colspan=1>col5
</table>
My two cents.

Related

Transpose variable number of rows into columns in OpenRefine

I have an xml file containing records from a library catalogue. I have imported it into OpenRefine but all the values are in one column. I want to transpose it so each field in the record has its own column. However, this is complicated by the fact that a) each field is optional so does not exist in all records and b) many fields are repeatable so can appear multiple times in each record. Here's a simplified example of what the data looks like:
| RecordID | Tag | Data |
| 1 | 040a | CaABCD |
| 1 | 245a | Go fish |
| 1 | 245a | A guide to fish |
| 1 | 246i | Fish series |
| 1 | 260a | Fishing friends |
| 2 | 040a | CaABDC |
| 2 | 245a | Happy trails |
| 2 | 246i | Hiking series |
| 2 | 260i | The happy hiker |
| 2 | 500a | Notes |
I have read the Q&A here Openrefine - Transpose rows into columns based on text but the problem with this solution is that if I concatenate all the values together I have no way to be sure what field they belong in anymore, as my data is much more complicated than the data in that question (my actual data has 25+ fields and many thousands of records).
I was able to get closer using Google Sheets and making a pivot table with a calculated field (as in PivotTable to show values, not sum of values - see the answer at the very bottom). However, I still don't know how to handle the repeating fields. In the pivot table the multiple values are there but only the first displays (double-clicking on an individual cell brings up a details table which lists all the values), so when I copy-paste the table I lose the additional values. I would like to concatenate them but I cannot see a way to do so within the pivot table.
Can you think of any other way I could do this, in OpenRefine or another tool? Thanks!
The classic way to fix this in OpenRefine is to use "Transpose -> Columnize by key value". But this feature is poorly documented and can cause headaches even for OpenRefine developers. In your case, repeated fields will be problematic, so here is a possible solution.
1° Go to the "tag" column, click on "Transpose -> Columnize by key value" and use the following configuration (don't forget the "Note column (optional)")
The result will look like this (my dataset is not exactly the same as yours, I modified a value to do some test)
2° In the new column "Record ID: 040 a", click on "edit column -> Move Column To Beginning".
3° If you want to merge the repeated fields, go to each column that contains them and click on "Edit Cells -> Join Multi Value cells" by choosing a separator, for example "|".
The end result will look like this.
To get rid of unnecessary columns: Click on Export -> Custom tabular export and deselect the columns whose name starts with RecordId.
OpenRefine also has a native MARC importer which might be something worth trying if you need to work with MARC data in the future. MARCEdit also has some specific OpenRefine support built in.

Bi Publisher empty page when using tables in PDF output

RTF template defines a table that has a header row and and a single content row.
The content row has a Field that contains a for loop like this to populate the rows based on a XML data file:
<?for-each:row_MYDATA?>
...
...
<?end for-each?>
The issue happens when the table grows past the end of the page and overflows to the next page. The next page is as expected and contains the extra data just fine, but a page before the table beginning gets inserted and it's empty.
A text diagram of the issue if the table exceeds a single page:
| Empty page |
| Table begins|
| Table cont. |
Expected:
| Table begins|
| Table cont. |

SQL - return rows with a duplicate value, where one row in each group has a certain attribute and not another

I am a SQL novice at best - appreciate any help on this answer. It's specific to the program MediaMonkey, but more broadly applicable I think since MediaMonkey's database is I believe SQLite 3. The table I'm querying is called Songs and all the columns I'm referencing are in this table.
I am using the Custom4 field in MediaMonkey to store a song's Work ID from Musicbrainz, and the Custom5 field to store the AcoustID. I'm trying to create a playlist of cover / alternate / live versions of songs that I've rated 5 stars, but where the 5 star song is not a classical work or a jazz recording (I use the Grouping field (GroupDesc) to indicate if a track is classical or jazz).
Parameters for the SQL query need to be something like this:
Same Work ID as a 5 star recording (Rating = 100), where the Grouping
of the 5 star recording is not 'Classical' or 'Jazz' (I am OK with
classical or jazz covers of 5 star popular works)
Different AcoustID from any 5 star recording (eliminate duplicate
recordings)
Rating < 5 stars (I don't want to include the 5 star songs
themselves)
I cobbled together the following SQL query from some examples I found:
Songs.Custom4 IN (SELECT Custom4 FROM Songs GROUP BY Custom4 HAVING Count(*) > 1 AND Max(Rating) > 99 AND Custom4 <> '' AND GroupDesc <> 'Classical' AND GroupDesc <> 'Jazz')
What this appears to include is the following:
Same WorkID as a 5 star recording
Classical or jazz tracks only if the classical or jazz track is rated
5 stars and there is another track with the same Work ID that is not
classical or jazz, or if the classical or jazz track has the same
Work ID as a 5 star recording that is not classical or jazz
Includes duplicates of the 5 star recording, and includes the 5 star
recordings themselves
Somehow then I need to filter out the 5 star classical or jazz tracks and the tracks that have the same Work IDs as those tracks, and I need to exclude the duplicates and the 5 star recordings.
Let's say you have a table like this:
<table class="blueTable">
<thead>
<tr>
<th> Song</th>
<th>Grouping</th>
<th>Rating</th>
<th>Work ID</th>
<th>AcoustID</th>
</tr>
</thead>
<tbody>
<tr>
<td>A1</td>
<td>Classical </td>
<td>100 </td>
<td>a12 </td>
<td>b12 </td>
</tr>
<tr>
<td>A2</td>
<td>Jazz </td>
<td>100 </td>
<td>a21 </td>
<td>b21 </td>
</tr>
<tr>
<td>A3</td>
<td> NULL</td>
<td>100 </td>
<td>a31 </td>
<td>b31 </td>
</tr>
<tr>
<td>A4</td>
<td>NULL </td>
<td>NULL </td>
<td>a12 </td>
<td>b41 </td>
</tr>
<tr>
<td>A5</td>
<td>NULL </td>
<td>NULL </td>
<td>a31 </td>
<td>b31 </td>
</tr>
<tr>
<td>A6</td>
<td>Classical </td>
<td>NULL </td>
<td>a31 </td>
<td>b61 </td>
</tr>
<tr>
<td>A7</td>
<td>NULL </td>
<td>NULL </td>
<td>a31 </td>
<td>b71 </td>
</tr>
</tbody>
</table>
I'd want my query to include the following songs: A6, A7
Here's the logic: A1 and A2 would be excluded since they are Classical and Jazz tracks and are not covers of a popular song with a rating of 100. A3 would be excluded since it has a rating of 100. A4 would be excluded since it's a popular cover of a Classical track that is rated 100. A5 would be excluded since it's a duplicate of A3. A6 is included - it's a Classical cover of A3. A7 is included - it's a cover of A3.

Choosing and keeping multiple radio button value inside a table

I am using radio button for choosing employee type such as part-time , full-time etc.I could choose only one item according followed table structure.How can i select multiple radio button and keep these inside a table.For instance such as keeping inside an array?
+--------------+----------------+
| EmployeeId | EmployeeType |
+--------------+----------------+
| 2 | 2 |
+--------------+----------------+
| 3 | 1 |
+--------------+----------------+
EmployeeTypes :
0 Part-time
1 Full-time
2 Consultant
3 Trainer
In HTML, radio buttons work by posting different values to the same name - the value of the item selected.
<form action="">
<input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female">Female
</form>
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_radio
However, if you have a table of data, and you need to be able to edit multiple rows at the same time, there will be the need to differentiate between EmployeeType for User 2 and EmployeeType for User 3. So the radio buttons with various values might now instead post to names such as EmployeeType_2 and EmployeeType_3.
This is essentially what will happen behind the scenes when you try to do code like the following.
How can I post a list of items in MVC
At some point here you may want to actually consider using a grid control, but I'm not trying to plug Telerik or DevExpress controls. So, instead I'll mention the following that came up in my search. Perhaps other users can suggest other controls.
http://www.codeproject.com/Tips/720348/MVC-Grid-Inline-Edit
http://www.codeproject.com/Articles/165410/ASP-NET-MVC-Editable-DataTable-jQuery-DataTables-a

how to get the index value from the table?

I'm trying to get the index value for the column that I create index. How to do this? What I mean is something like below:-
index value indexed field data
______________ ____________________
0 apple
1 orange
2 manggo
Use $index.
More info: http://www.youtube.com/watch?v=jEpbjve5iHk
...
<tbody>
<tr ng-repeat="fruit in fruitBasket">
<td>{{$index}}</td> <!-- --------See this line! -->
<td>{{fruit}}</td>
</tr>
</tbody>
...