I am using Pandoc to generate Wiki ->DOCX
My wiki file is
=Graph Shared With (3)=
{| class="wikitable"
|-
| '''ID'''
| '''Name'''
|-
|115 sirajTest ahmad sirajTestsirajTest ahmad sirajTest
|sirajTest ahmad sirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmad
|-
|15 sirajTest ahmad sirajTest
|Test Marquard sirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmad
|-
|92sirajTest ahmad sirajTestsirajTest ahmad sirajTestsirajTest ahmad sirajTest
|Ahtesham ul haqsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmad
|}
and the output is
In DOCX, long rows with text are simply broken up into multiple lines. In the PDF document this does not happen; a row is always a single line that do not wrap at the right margin but continue outside of the page
i am using Tex file as a template and in that we have
$if(tables)$
\usepackage{longtable,booktabs,multirow}
\setlength{\LTleft}{0pt}
$endif$
i tried to add multirow package but i dont think i am doing it correctly
there is one question in stack overflow similar to this but it is using markdown table but i am using media wiki table so its diffrent
Similar question
I think with multi row i can fix this but i do not know how :)
so is there any help or any one can guide me how can i solve this
You need to specify column widths, like:
{| class="wikitable"
! width="30%" | '''ID'''
! width="70%" | '''Name'''
|-
|115 sirajTest ahmad sirajTestsirajTest ahmad sirajTest
|sirajTest ahmad sirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmad
|-
|15 sirajTest ahmad sirajTest
|Test Marquard sirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmadsirajTest ahmad
|}
Related
I have an infobox in a template, where I'd like to add a table.
I added it, but could not obtain a good result.
An example of infobox is:
But I want the table in "composition" section to be as large as the rest of infobox.
Here the source code (I cut for the interesting parts):
{| style="float:right;border:1px solid gold"
! colspan="2" style="background:gold;width:200px;font-size:10pt" | {{#external_value:common_name}}
|-
| colspan="2" style="text-align:center;font-size:10pt" | [http://m.muninn.land/coins/{{#external_value:obverse_image}}]<br />
|-
| colspan="2" style="background:gold;text-align:center;font-size:9pt" | Description
|-
| style="font-size:9pt" | Currency: || style="font-size:9pt" | {{#external_value:currency_name}}
|-
Cut 8<
| style="font-size:9pt" | Form factor: || style="font-size:9pt" | {{#external_value:form_factor}}
|-
| colspan="2" style="background:gold;text-align:center;font-size:9pt" | Composition
|-
| colspan="2" style="font-size:9pt;text-align:left" | {{coin composition|id={{{id|2}}}}}
|}
Where the table in template "coin composition" is:
{| class="wikitable"
! Material:
! Percentage: {{#for_external_table:<nowiki/>
{{!}}-
{{!}} {{{composition}}}
{{!}} {{{percentage}}}
}}
|}
I tried to adjust column width:
https://www.mediawiki.org/wiki/Help:Tables#Column_width
but not with good results...
How can I enlarge the table in the infobox?
For example, a page of the site, in beta, is online at http://en.muninn.land/index.php/1000_lire_Capital_Rome_1970
for full source code.
Add style="width: 100%" to the table.
{| class="wikitable" style="width: 100%"
! Material:
! Percentage: {{#for_external_table:<nowiki/>
{{!}}-
{{!}} {{{composition}}}
{{!}} {{{percentage}}}
}}
|}
But a better solution would be to integrate composition into the main infobox (the template Coin details).
Rewrite the Coin composition template thus:
|-
| style="font-size:9pt" | Material: || style="font-size:9pt" | Percentage:
{{#get_db_data:
db=munin
|from=geo.v_coin_composition
|where=comp_coin_id={{{id|1}}}
|data=comp_coin_id=comp_coin_id,composition=composition,percentage=percentage
}}
{{#for_external_table:<nowiki/>
{{!}}-
{{!}} style="font-size:9pt" {{!}} {{{composition}}}
{{!}} style="font-size:9pt" {{!}} {{{percentage}}}
}}
|}
Invoke it from a new line and remove the preceding
|-
| colspan="2" style="font-size:9pt;text-align:left" |
Or simply replace its invocation with its new source code.
I need to align both information i.e PO number and Vendor properly, how to do it?
from
PO Number: 344 Vendor: yu
PO Number: 3445 Vendor: yu
PO Number: 344 Vendor: yu
to
PO Number: 344 Vendor: yu
PO Number: 3445 Vendor: yu
PO Number: 344 Vendor: yu
<div *ngFor="let n of listof_POs" style="color: white;">
<span><b>PO Number: {{n.po_number}} Vendor: {{n.vendorname}} </b></s
</div>
If you can use Angular Flex Layout, you can handle it like this.
<div *ngFor="let n of listof_POs" style="color: white;" fxLayout="row">
<b fxFlex="50%">PO Number: {{n.po_number}}</b>
<b fxFlex="50%">Vendor: {{n.vendorname}}</b>
</div>
You can also use CSS Flexbox to achieve this
Looks like your trying to create a table in a really difficult way why not try something like the following: https://www.w3schools.com/angular/angular_tables.asp
HTML
<table>
<tr ng-repeat="n in listof_POs">
<td>PO Number: {{ n.po_number}}</td>
<td>Vendor {{ n.vendorname}}</td>
</tr>
</table>
I have a text string like this:
Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 . For What it’s
Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin . Fever
Emiliana Torrini . Me and Amini Cowboy Junkies . Run for your Life Mira
Billotte . As I Went out in the Morning Nitin Sawhney feat. Tina Grace
. October Daze Isobel Campbell . Saturday’s Gone Barbara . Mes
Hommes...
And I want to use the line break character in my string as parameters of my table. I want something like this :
Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .
For What it’s Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .
Fever Emiliana Torrini . Me and Amini Cowboy Junkies .
Run for your Life Mira Billotte . As I Went out in the Morning Nitin Sawhney feat.
Tina Grace . October Daze Isobel Campbell .
Saturday’s Gone Barbara . Mes Hommes...
It can be a (\n) or any other character. At the end of each line there is a line break character.
Someone have an idea?
Your question has an incorrect formulation. ( "...i want to use the line break characte..." than you've said "...It can be a (\n) or any other character. ..." )
You can use tag </br>
Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .</br> For What it’s
Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .</br> Fever
Emiliana Torrini . Me and Amini Cowboy Junkies .</br> Run for your Life Mira
Billotte . As I Went out in the Morning Nitin Sawhney feat.</br> Tina Grace
. October Daze Isobel Campbell .</br> Saturday’s Gone Barbara . Mes
Hommes...
Please explain your problem a little more. Is that string being placed inside one column? If so then why don't you make the column a specific width E.g:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<col width="330">
<col width="80">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 . For What it’s
Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin . Fever
Emiliana Torrini . Me and Amini Cowboy Junkies . Run for your Life Mira
Billotte . As I Went out in the Morning Nitin Sawhney feat. Tina Grace
. October Daze Isobel Campbell . Saturday’s Gone Barbara . Mes
Hommes...</td>
<td>This is under column 2</td>
</tr>
<tr>
<td>This is another long string. This is another long string. This is another long string. This is another long string. This is another long string. This is another long string. This is another long string. This is another long string. This is another long string. </td>
<td>Again this is under column 2... also a long string:Again this is under column 2... also a long string: Again this is under column 2... also a long string: Again this is under column 2... also a long string: </td>
</tr>
</table>
<p>The col width attribute is not supported in HTML5.</p>
</body>
</html>
Or do you want each one of those to be in separate columns/rows
I don't know if i should do the thing like this.
<table v-for="piste in details.text_tracks">
<tr>
<td>{{details.text_tracks}}</td>
</tr>
</table>
var details.text_tracks = "Jenny Lewis . Pretty Bird Sergio Mendes &
Brasil 66 .\n For What it’s Worth Petra Magoni feat. Jean-Jacques
Milteau & Manu Galvin .\n Fever Emiliana Torrini . Me and Amini Cowboy
Junkies .\n Run for your Life Mira Billotte . As I Went out in the
Morning Nitin Sawhney feat.\n Tina Grace . October Daze Isobel Campbell
.\n Saturday’s Gone Barbara . Mes Hommes...\n"
This is my full code. I want a table that create cell for each line.
Standalone code
var details = {};
details.text_tracks = "Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .\n For What it’s Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .\n Fever Emiliana Torrini . Me and Amini Cowboy Junkies .\n Run for your Life Mira Billotte . As I Went out in the Morning Nitin Sawhney feat.\n Tina Grace . October Daze Isobel Campbell .\n Saturday’s Gone Barbara . Mes Hommes...\n";
details.text_tracks = details.text_tracks.replace(/(?:\r\n|\r|\n)/g, '<br />');
document.getElementById("my-text").innerHTML = details.text_tracks;
<div id="my-text">
</div>
Modification in your code
You should replace \n with <br> Use the below code
var details.text_tracks = "Jenny Lewis . Pretty Bird Sergio Mendes &
Brasil 66 .\n For What it’s Worth Petra Magoni feat. Jean-Jacques
Milteau & Manu Galvin .\n Fever Emiliana Torrini . Me and Amini Cowboy
Junkies .\n Run for your Life Mira Billotte . As I Went out in the
Morning Nitin Sawhney feat.\n Tina Grace . October Daze Isobel Campbell
.\n Saturday’s Gone Barbara . Mes Hommes...\n"
details.text_tracks = details.text_tracks .replace(/(?:\r\n|\r|\n)/g, '<br />');
You can also do this in the server side code before sending it client.
I'm not sure what you are really asking for, but as far as I understand you would like your text string in one text area or text box.
You could form a text area using HTML by the following code,
<th colspan="3" rowspan="9" id="textarea">
<textarea id = "textInput" rows = "13" cols = "100">
</textarea>
</th>
Where colspan, rowspan, id, rows and cols can be defined by you.
And in javascript you can use,
textarea = document.getElementById('textInput');
textarea.value = 'Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .\n For What it’s Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .\n Fever......';
or...
textarea = document.getElementById('textInput');
textarea.value = 'Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .\n';
textarea.value = textarea.value + 'For What it’s Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .\n';
and repeat the textarea.value = textarea.value + 'blablabla \n';
Here you are... right now it calls the function on button click but that can easily be changed.
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
var str = "Jenny Lewis . Pretty Bird Sergio Mendes & Brasil 66 .</br> For What it’s Worth Petra Magoni feat. Jean-Jacques Milteau & Manu Galvin .</br> Fever Emiliana Torrini . Me and Amini Cowboy Junkies .</br> Run for your Life Mira Billotte . As I Went out in the Morning Nitin Sawhney feat.</br> Tina Grace . October Daze Isobel Campbell .</br> Saturday’s Gone Barbara . Mes Hommes...;"
var res = str.split("</br>").join("</td></tr><tr><td>");
document.getElementById("demo").innerHTML += "<td>" + res + "</td></tr>";
}
</script>
<p>Click the button to display the array values after the split.</p>
<button onclick="myFunction()">Try it</button>
<style>
table, th, td {
border: 1px solid black;
}
</style>
<table id="demo">
<col width="130">
<tr>
<th>Column 1</th>
</tr>
</table>
</body>
</html>
My problem is kind of specific. I've been looking at all the other BeautifulSoup questions here on SO but have yet to come up with an answer to my issue. I have taken a pdf file and turned it into somewhat decent html with the intention of further transcribing this to a csv file.
My web page i'm working from looks like this, except i redacted a bunch of stuff i wasn't sure i wanted available to the average googler:
(RUSI) US Foundation
Last Updated: 2014-12-29
At A Glance
[st # redacted] I St. N.W.
Washington, DC United States 20006
Type of Grantmaker
Independent foundation
Financial Data
(yr. ended 2013-12-31)
Assets: $3,085 Total giving: $0
EIN
[redacted]
990
[redacted]
Application Information
Unsolicited requests for funds not accepted.
Application form not required.
Directors Michael Clarke Sean Murphy Timothy Voake
Financial Data
Year ended 2013-12-31
Assets: $3,085 (market value)
Expenditures: $387
Total giving: $0
Qualifying distributions: $387
Additional Location Information
County: District of Columbia
Metropolitan area: Washington-Arlington-Alexandria, DC-VA-MD-WV Congressional district: District of Columbia District At-large
04Arts Foundation
Last Updated: 2013-05-15
At A Glance
P.O. Box [redacted]
San Antonio, TX United States 78283-1253 Telephone:(210) [redacted] Contact: Penelope Speier URL: www.04arts.org
Type of Grantmaker
Independent foundation
Financial Data
(yr. ended 2012-12-31)
Assets: $40,957 Total giving: $1,698
EIN
[redacted]
990
[redacted]
Additional Contact Information
Application Address: [redacted] Dallas, New Braunfels, TX 78130
Background
Established in 1995 in TX.
Limitations
No grants to individuals.
Fields of Interest Subjects
Arts
Application Information
Application form not required.
Initial approach: Proposal Deadline(s): None
Donor(s)
Note: If a donor is deceased, the symbol (f) follows the name.
Penelope Gallagher William Gallagher Edward Everett Collins, III Edwards Aquifer Authority
Officer
Penelope Speier, Pres.
Directors Wendy W. Atwell Jon Cochran
Financial Data
Year ended 2012-12-31
Assets: $40,957 (market value)
Gifts received: $[redacted] Expenditures: $[redacted] Total giving: $[redacted] Qualifying distributions: $[redacted] Giving activities include:
$[redacted] for grants
Additional Location Information
County: Bexar
Metropolitan area: San Antonio, TX Congressional district: Texas District 35
1 in 9: The Long Island Breast Cancer Action Coalition, Inc
Last Updated: 2011-12-19
At A Glance
[redacted] E. Rockaway Rd.
Hewlett, NY United States 11557-1736 Telephone:(516) [redacted] Fax: (516) [redacted] E-mail: [redacted]
Type of Grantmaker
Public charity
Additional Descriptor
Organization that normally receives a substantial part of its support from a governmental unit or from the general public
EIN
[redacted]
990
[redacted]
Purpose and Activities
The coalition's mission is to promote awareness of the breast cancer epidemic through education, outreach, advocacy, and direct support of research which is being done to find the causes of and cures for breast cancer and other related cancers.
Fields of Interest Subjects
Breast cancer
Breast cancer research
Cancer
Cancer research
Types of Support
Research
Publications
Newsletter
Officers and Directors
Note: An asterisk (*) following an individual's name indicates an officer who is also a trustee or director.
Geri Barish *, Pres.
Louise Levrie, V.P.
Larry Slatky *, Treas.
Caroline Boss Fran Kritchek Frank P. Naudus Leon Newman
Additional Location Information
County: Nassau
Metropolitan area: New York-Northern New Jersey-Long Island, NY-NJ-PA Congressional district: New York District 04
My html currently looks like this (exactly like this, so be warned, it's horrid):
<p style="text-align:justify;"><span class="font7" style="color:#CB4810;">FOUNDATION</span></p><a name="caption1"></a><h1 style="text-align:justify;"><a name="bookmark0"></a><span class="font7" style="color:#CB4810;">DIRECTORY</span></h1><div style="float:right;layout-flow:horizontal;">
<p><span class="font4">Save this Page</span></p></div>
<p style="text-align:justify;"><span class="font1" style="color:#ED977A;">ONLINE </span><span class="font1" style="color:#9D9D9D;">.*>. </span><span class="font1" style="font-weight:bold;color:#9D9D9D;">A </span><span class="font1" style="color:#9D9D9D;">service of the </span><span class="font1" style="color:#808080;">_ </span><span class="font1">...... _</span></p>
<p style="text-align:right;padding:0pt 0pt 23pt 0pt;"><span class="font4" style="text-decoration:underline;">Print this Page</span></p>
<p style="text-align:justify;padding:23pt 0pt 9pt 0pt;"><span class="font4">(</span><span class="font4" style="font-weight:bold;">Refinements: </span><span class="font4">Grantmaker Name: *)</span></p><h2 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark1"></a><span class="font6" style="font-weight:bold;">(RUSI) US Foundation</span></h2>
<p style="text-align:justify;padding:0pt 0pt 14pt 0pt;"><span class="font1" style="font-weight:bold;">Last Updated: </span><span class="font2">2014</span><span class="font0">-</span><span class="font2">12-29</span></p><h3 style="text-align:justify;padding:14pt 0pt 0pt 0pt;"><a name="bookmark2"></a><span class="font5" style="font-weight:bold;">At A Glance</span></h3>
<p style="text-align:justify;"><span class="font4">1776 I St. N.W.</span></p>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">Washington, DC United States 20006</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark3"></a><span class="font4" style="font-weight:bold;">Type of Grantmaker</span></h4>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">Independent foundation</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark4"></a><span class="font4" style="font-weight:bold;">Financial Data</span></h4>
<p style="text-align:justify;"><span class="font4">(yr. ended 2013-12-31)</span></p>
<p style="padding:0pt 421pt 9pt 0pt;"><span class="font4">Assets: $3,085 Total giving: $0</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark5"></a><span class="font4" style="font-weight:bold;">EIN</span></h4>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">721374719</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark6"></a><span class="font4" style="font-weight:bold;">990</span></h4>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">2013 2004 2003 2002</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark7"></a><span class="font4" style="font-weight:bold;">Application Information</span></h4>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">Unsolicited requests for funds not accepted.</span></p>
<p style="text-align:justify;padding:9pt 0pt 14pt 0pt;"><span class="font4">Application form not required.</span></p>
<p style="padding:14pt 421pt 14pt 0pt;"><span class="font4" style="font-weight:bold;">Directors Michael Clarke Sean Murphy Timothy Voake</span></p><h4 style="text-align:justify;padding:14pt 0pt 0pt 0pt;"><a name="bookmark8"></a><span class="font4" style="font-weight:bold;">Financial Data</span></h4>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4" style="font-weight:bold;">Year ended 2013-12-31</span></p>
<p style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><span class="font4">Assets: $3,085 (market value)</span></p>
<p style="text-align:justify;"><span class="font4">Expenditures: $387</span></p>
<p style="text-align:justify;"><span class="font4">Total giving: $0</span></p>
<p style="text-align:justify;padding:0pt 0pt 9pt 0pt;"><span class="font4">Qualifying distributions: $387</span></p><h4 style="text-align:justify;padding:9pt 0pt 0pt 0pt;"><a name="bookmark9"></a><span class="font4" style="font-weight:bold;">Additional Location Information</span></h4>
<p style="text-align:justify;"><span class="font4">County: District of Columbia</span></p>
Now, when i use BS by running this code;
from bs4 import BeautifulSoup as Soup
html = Soup(open('found1.html'))
titles = html.find_all('h2', style="text-align:justify;padding:9pt 0pt 0pt 0pt;")
print(titles[0].find(text=True))
print(titles[0].find_next('p', style="text-align:justify;padding:0pt 0pt 14pt 0pt;").\
find_all(text=True))
print(titles[0].find_next('span', class_="font5",\
style="font-weight:bold;").find(text=True))
I get;
(RUSI) US Foundation
['Last Updated: ', '2014', '-', '12-29']
At A Glance
Which is great! The next part i'm having difficulty with. I need to grab everything between 'At A Glance' and 'Type of Grantmaker'. I then need to do this for 'Type of Grantmaker' and the next set. One nice thing about this is that the tags are almost always the same for similar titles. For instance, that's how i can get the name of all the titles with my titles = html.... code.
My desired output is a list that looks like this:
[[first organization, last_updated, at_a_glance, type_of_grantmaker, financial_data, ...],
[second organization, ...], [third organization, ...], ...]
Any steps in the right direction are most appreciated! And if you think my question sucks for whatever reason, i would appreciate a comment along with the -1 so i can fix it. I'm new, and my last questions were not well received...
It turns out the simplest way for me to do this is by splitting it before putting it into BeautifulSoup. So what i did is split it using the following code and then am (currently) writing a function to deal with breaking text up nicely.
from bs4 import BeautifulSoup as Soup
with open('found1.html', 'r') as f:
html = f.read()
sections = html.split('</a><span class="font6" style="font-weight:bold;">')
# Developing this bit to extract text cleanly.
def extract(html):
html = Soup(html)
html.find_all(text=True)
print(extract)
print(html.text)
# Gives me the whole html between the first title and the second
print(sections[1])
extract(sections[1])
This data are show in the web browser but not in the mobile app
i already check the internet connection in mobile but cant't get it any answer
This is my code
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-controller="customersController">
<ul>
<li ng-repeat="x in names">
{{ x.Name + ', ' + x.Country }}
</li>
</ul>
</div>
<script>
function customersController($scope,$http) {
$http.get("http://www.w3schools.com//website/Customers_JSON.php")
.success(function(response) {$scope.names = response;});
}
</script>
</body>
</html>
But my mobile is show me this output ->
{{ x.Name + ', ' + x.Country }}
but my web browser show me the correct answer
Alfreds Futterkiste, Germany
Berglunds snabbköp, Sweden
Centro comercial Moctezuma, Mexico
Ernst Handel, Austria
FISSA Fabrica Inter. Salchichas S.A., Spain
Galería del gastrónomo, Spain
Island Trading, UK
Königlich Essen, Germany
Laughing Bacchus Wine Cellars, Canada
Magazzini Alimentari Riuniti, Italy
North/South, UK
Paris spécialités, France
Rattlesnake Canyon Grocery, USA
Simons bistro, Denmark
The Big Cheese, USA
Vaffeljernet, Denmark
Wolski Zajazd, Poland
In this case what can i do for mobile app