Goal: have two H6() on the same line.
I know to do this by having one Row() and two Col(). I am struggling to implement it ;(
Attempts:
...
# H6('Line markers'),
# H6('Line colors'),
# H6('Line markers', 'Line colors')
Row(Col(Div([H6('Line markers')]))),
Row(Col(Div([H6('Line colors')]))),
#Row(Col(Div([H6('Line markers'), H6('Line colors')]))),
...
Webpage:
Line markers
Line colors
Desired Webpage:
Line markers Line colors
No error in runtime but just aesthetically annoying.
You can do this with flex box. Wrap both in a div with style=dict(display='flex').
...
Row([Col(Div([H6('Line markers')])),
Col(Div([H6('Line colors')]))]),
...
Related
I want to place my text so i can get something like:
"SomeText1
SomeText2 One ...
two ...
three ..."
And I need to customize each of sometexts and 1,2,3 separately.
So I use the code
Label{
...
textFormat: Text.RichText
text: <html><b><div style='font-size: 12pt;'> SomeText1</div></b></html>+
<html><i><div style='font-size: 12pt;'> SomeText2</div></i></html>+
(here must be a function which back some big text)
...
}
This code works great except one thing... It acts like ".simplefield()" and just "eat" all 2+ spaces and doesn't allow to use "\n". What can I do to change this?
I found the solution of my problem. When I type:
"1
2
3"
I see "1 2 3", but actually it is "1\n2\n3". My html-ed label doesn't react to "\n". So I just added a function in my .cpp, which replaced "\n" with "br". Here is it
str.replace("\n","<br>");
I'm trying to figure out how to add line spacing without adding spacing above the very first line of textflow.
This code:
$text = 'For more information about the Giant Wing Paper Plane see ' .
'our Web site <underline=true>www.kraxi-systems.com' .
'the Giant Wing in a thunderstorm as soon as possible.';
$optlist = 'fontname=Helvetica fontsize=12 encoding=unicode leading=400%';
$tf = $p->create_textflow($text, $optlist);
$result = $p->fit_textflow($tf, 28.346, 28.346, 400, 700, 'fitmethod=nofit');
$p->delete_textflow($tf);
results in:
All is good.
Next, I'm increasing the leading option to 400% as:
$optlist = 'fontname=Helvetica fontsize=12 encoding=unicode leading=400%';
And that gives me this:
Question:
How do I keep first paragraph line at the original position and only increase line spacing AFTER it?
checkout the "firstlinedist" option. The default is leading, but you might set this to "ascender" or "capheigt" or any other value.
Please see PDFlib 9.2 API reference, chapter 5.2, table 5.12 for more details.
Really simple (in theory): is there a way to insert line breaks in google forms questions? Here's what I'm looking at:
form.addScaleItem()
.setTitle('Question?')
.setHelpText('(1 = Poor 2 = Poorer')
.setBounds(1, 7)
.setLabels(lower= 'lower label line 1, lower label line 2',upper= 'upper label')
.setRequired(false);
Ideally, I'd like to be able to put line breaks in the setHelpText and/or setLabels, but the usual html <>'s (br, /br, br/, p, etc.) don't work. Thoughts or workarounds?
You can do it by using standard js line break "\n":
var item; // = ...
item.setTitle("To be?\nOr not to be?");
I'd like to print a plot with y-error-bars and just plain points. My current Octave script looks like this:
errorbar(x_list, y_list, Delta_y_list, "~.x");
title("physikalisches Pendel");
xlabel("a^2 [m^2]");
ylabel("aT^2 [ms^2]");
print -dpdf plot.pdf
The plot I get has a line, although I specified the .x style option:
http://wstaw.org/m/2012/04/14/umbrella5.png
How can I get rid of that line?
And the ylabel is in the scale as well, is there some way to fix that?
One has to set the linestyle:
p1 = errorbar(plot_x, plot_y, plot_error, "~.k");
set(p1, "linestyle", "none");
set(p1, "marker", "+");
Is there a way to remove an entire row (html tags 'n all) from an HTML Table with HTML::TableExtract?
Mucking around with the sample code from CPAN, this is what I've tried so far:
use HTML::TableExtract qw(tree);
my $te = HTML::TableExtract->new( headers => [qw(name type members)] );
# get $html_string out of a file...
$te->parse($html_string);
my $table = $te->first_table_found();
my $table_tree = $table->tree;
$table_tree->row(4)->replace_content('');
my $document_tree = $te->tree;
my $document_html = $document_tree->as_HTML;
# write $document_html to a file ...
Now, as the name suggests, 'replace_content()' in the line $table_tree->row(4)->replace_content(''); removes the content of row 4, but the row itself remains in markup. I need to get the tags and everything in-between removed as well.
Any ideas?
What you want is the parent and delete methods
See the docs for HTML::Element and for HTML::Element::delete
UPDATE
Ok, click that checkmark and mark this one as answered....Here it is:
my($p) = $table_tree->row(4)->parent();
$p->delete;
Also, NOTE, you need the () parens around $p! If you don't have parens don't get back a reference.
For me, with the above Perl code working on this HTML,
<table>
<tr><td>name</td><td>type</td><td>members</td></tr>
<tr><td>row1</td><td>row1</td> <td>row1</td></tr>
<tr><td>row2</td><td>row2</td> <td>row2</td></tr>
<tr><td>row3</td><td>row3</td> <td>row3</td></tr>
<tr><td>row4</td><td>row4</td> <td>row4</td></tr>
</table>
I get this as a result of printing $document_html
<table>
<tr><td>name</td><td>type</td><td>members</td></tr>
<tr><td>row1</td><td>row1</td><td>row1</td></tr>
<tr><td>row2</td><td>row2</td><td>row2</td></tr>
<tr><td>row3</td><td>row3</td><td>row3</td></tr>
</table>
Notice that there is no empty <tr></tr>