Chat about languages :)

Started by Mejda, May 19, 2012, 07:00:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mejda

I am in class timetableexport exactly in function "singleTeachersTimetableDaysVerticalHtml(int htmlLevel, int teacher, const QString& saveTime, bool printActivityTags)
And my object is to insert in PDF version 2 strings but should be spaced
so I do
QString chaine=QString("Nombre des heurs de cour:");
chaine+=QString(" ").repeated(5);
chaine+=QString("Nombre des heurs de TD:")

I get:
Nombre des heurs de cour:     Nombre des heurs de TD:



Liviu Lalescu

#16
Yes, and if you see the HTML with the browser, it looks good.

For instance, in the FET page http://lalescu.ro/liviu/fet/credits.html , under Authors (at the beginning), Volker Dirr's contributions begin with spaces.

The HTML code for the file above (credits.html) is:


<p><b>Authors:</b>
</p>
<p>Liviu Lalescu</p>
<br />

<p>Volker Dirr
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- XHTML timetable export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- CSV import and export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Advanced statistics export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Speed improvements in the timetable generation.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Locking the activities.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Activity planning dialog.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Print timetable dialog.
</p>
<br />
<p>To contact an author, please see the AUTHORS file in the FET distribution or the FET menu Help/About/Authors</p>
<br />


Mejda

I do not understand what I should write because with this instruction  "chaine+=QString("&nbsp;").repeated(5);"  I hav'nt spaces I have "&nbsp" repeated  :(

Liviu Lalescu

#18
This "&nbsp;" is HTML code. The source of HTML contains "&nbsp;", but if you open it with Chromium/Firefox (internet browser) you will see it as a space. See my link to credits.html and the source HTML code of credits.html.

I think that you are generating HTML code (and convert it to pdf, but after that).

In HTML source, if you add more spaces as "     ", they will be considered a single space. You need to add "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".

Please let me know if you understood now (or maybe I misunderstood?)

Mejda

I understant that I must modify my file.html but in my case I want that be by C++ code because chaines "Nombre des heurs de TP:"  is not in html code and I can't insert this string in my timetable with html code

Liviu Lalescu

#20
Hmm, sorry, I do not understand.

1)  You want when you open a HTML file in internet browser to see the spaces? In this case, you should use "&nbsp;" in the HTML file, and you can write that using C++ code.

2) You want something else? Please give me more details.

Mejda

Hi Liviu
we can resolve this problem by insertion of a table (1 row and 3 column) first column we affiche "nombre des heurs de cour",second column we affiche "nombres des heurs TD" et third column we affiche "nombre des heurs TP" :)  how I can do this ?
And please how I modify color of the border of timetable because in class timetableprintform I can modify just fond  :)

Mejda

I hope that you understand me so I explain in above of the timetable of a teacher I want see those information(number of hours of TD,number of hours of TP and number of hours of cour) so 2 solution
1)insert a table in above of teacher timetable like I was described it( 1 row 3 column)
2) insert those 3 informations but spaced

this what I want to do but in second solution I can't identify how insert spaces :)

Liviu Lalescu

There are many HTML tutorials, here are some links that I found on Google about your specific problems:

http://www.w3schools.com/html/html_tables.asp , http://www.w3schools.com/css/css_table.asp and http://www.hitmill.com/html/tables/two_d.html#bordercolor

As for the second solution, with spaces, it is exactly what I described earlier, with "&nbsp;", but I don't know why it does not work for you.