I'm using html2pdf
with my Django project
in order to create some PDF files and I get an HTML problem.
I would like to put two elements situated on the same line but the first one is located into the right side and the other one to the left side.
My script looks like :
<html>
<head>
{% load staticfiles %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{% static 'css/BC_base.css' %}"/>
<style>
body {
font-family: Courier New, Courier, monospace;
/*text-align: justify;*/
list-style-type: none;
}
.alignleft {
float: left;
border-right : 100px;
}
.alignright {
float: right;
border-left: 100px;
}
.title {
border-top: 150px;
font-size: 7;
}
{% block style %}
@page {
size: landscape;
}
{%endblock%}
</style>
</head>
<h2 class = "title" align="center" > ATTESTATION DE RECENSEMENT </align> </h2>
<div id="textbox">
<p class="alignleft">Le maire de la commune <br />de {{mairie.city}}</p>
<p class="alignright">Imprimé n° {{ar.id}}<br/> Loi n° ... du XX XX XXXX</p>
</div>
But I don't overcome to put alignleft
and alignright
classes on the same line.
I'm using the library html2pdf
to do that so all CSS command are not take account.
Thank you if you have an idea ?
EDIT :
This is what I'm getting with @ShivkumarKondi answer :
` ? `
` ? I'm really new with html
– Essex Feb 15 '17 at 13:54