title: Fix bootstrap table in weasyprint generated PDF
body: <p>I'm trying to create a PDF table with Weasyprint in my Django website. The same table is shown in a html page and with Weasyprint. When I use bootstrap colors in the html version it shows correctly, but the colors are lost on the Weasyprint version. That is the only feature missing on the Weasyprint version, which works otherwise.</p>
  
  <p>views.py</p>
  
  <pre><code>@login_required
  def scale_answer_pdf(request, scale_id):
      scale = get_object_or_404(UserScale, pk=scale_id)
      if scale.user == request.user or request.user.is_superuser:
          if scale.scale_meta.title == "Now":
              choices = NowLegend
              class ScaleForm(forms.ModelForm):
                  class Meta:
                      model = NowModel
                      fields = labellist(NowLabels)
                      labels = NowLabels
          if scale.scale_meta.title == "Child":
              choices = NowLegend
              class ScaleForm(forms.ModelForm):
                  class Meta:
                      model = ChildModel
                      fields = labellist(ChildLabels)
                      labels = ChildLabels
          form = ScaleForm(instance=scale)
          **html = render_to_string('diagnosis/scale_answer_pdf.html', 
  {'form': form, 'scale':scale, 'choices':choices})
          response = HttpResponse(content_type='application/pdf')
          response['Content-Disposition'] = 'filename="{} - {} - 
  {}.pdf"'.format(scale.scale_meta.title, scale.user.username, 
  scale.created.strftime('%Y-%m-%d'))
         weasyprint.HTML(string=html, 
  base_url=request.build_absolute_uri()).write_pdf(response, 
  presentational_hints=True, stylesheets= 
  [weasyprint.CSS(settings.STATIC_ROOT + '/css/sb-admin-2.min.css'), 
  weasyprint.CSS(settings.STATIC_ROOT +'/css/all.min.css')])
          return response**
      else:
          raise Http404
  </code></pre>
  
  <p>html for the PDF - the boostrap CSS works, and the table is also showing. But the colors from the table don't. I highlight the table parts that don't show colors</p>
  
  <pre><code>    {% extends "base_pdf.html" %}
  {% load i18n %}
  {% load staticfiles %}
  {% load get_item %}
  {% block content %}
  &lt;div class="container-fluid"&gt;
       &lt;div class="row"&gt;
  &lt;div class="col-sm-6 mx-auto" &gt;
      &lt;p class="text-center"&gt;&lt;img height="120" width="120" src="{{scale.scale_meta.icon.url}}" alt="Test icon" class="img-fluid"&gt;&lt;/p&gt;
      &lt;/br&gt;
      &lt;h1 class="text-center"&gt;{{scale.meta.title}}&lt;/h1&gt;
          {% with scale.created as created %}
          {% with scale.user.username as username %}
      &lt;h4 class="text-center"&gt;{% blocktrans %}Created the {{created}} by {{username}}{% endblocktrans %}&lt;/h4&gt;
      &lt;/br&gt;
  
    &lt;table class="table table-striped"&gt;
         &lt;tbody&gt;
          **&lt;tr class="table-info"&gt;**
      &lt;td&gt;{% trans "Question" %}&lt;td&gt;
      &lt;td&gt;{% trans "Answer type" %}&lt;td&gt;
      &lt;td&gt;{% trans "Answer" %}&lt;td&gt;
          &lt;/tr&gt;
      {% for field in form %}
      {% with name=field.name %}
      {% if choices|get_item:name == "0 to 6" %}
          {% if field.value &gt; "4" %}
          **&lt;tr class="table-danger"&gt;**
          {% endif %}
           {% if field.value &gt; "2" and field.value &lt; "5" %}
          **&lt;tr class="table-warning"&gt;**
          {% endif %}
          {% if field.value &lt;= "2" %}
          **&lt;tr class="table-success"&gt;**
          {% endif %}
      {% elif choices|get_item:name == "0 to 10" %}
          {% if field.value &lt;= "4" %}
          **&lt;tr class="table-danger"&gt;**
          {% endif %}
           {% if field.value &gt; "4" and field.value &lt; "7" %}
          **&lt;tr class="table-warning"&gt;**
          {% endif %}
          {% if field.value &gt;= "7" %}
          **&lt;tr class="table-success"&gt;**
          {% endif %}
      {% endif %}
      &lt;td&gt;{{field.label}}&lt;td&gt;
      &lt;td&gt;{{choices|get_item:name}}&lt;td&gt;
      &lt;td &gt;{{field.value}}&lt;td&gt;
          &lt;/tr&gt;
      {% endwith %}
      {% endfor %}
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
       &lt;/div&gt;
  &lt;/div&gt;
   &lt;br/&gt;
   &lt;br/&gt;
  {% endwith %}
  {% endwith %}
  {% endblock %}
  </code></pre>