Forum How do I...?

Floating a table leaves a blank space in the body text ... any solutions?

hughmcguire
Hi Mike et al,

I am using the following CSS on my tables:

table { 
    float: to unless-fit; 
    display: block;
}


it does as expected with the table, however it leaves a blank space where the floated table *would have been* inline.

a) is this expected behaviour?
b) is there a way to make that unwanted blank space go away?
c) if not, is this something that is expected to be addressed at some point?

full code:

<html>
<head>
<style type="text/css">

table {
  font: lighter 0.9em;
  display: block;
  page-break-inside: avoid;
  border-collapse: collapse;
  width: auto;
  float: top unless-fit;
}

table + p {
  text-indent: 1.5em;
}

table caption {
  font-family: "Bench Nine", sans-serif;
  font-weight: lighter;
  text-transform: uppercase;
  text-align: left;
  font-size: 1.2em;
  margin-top: 0;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid;
  prince-caption-page: all;
  background-color: red;
}

thead th.thead1 {
  font-weight: bold;
  font-family: "Bench Nine", sans-serif;
  text-align: left;
  font-size: 1.2em;
  border-bottom: 0px;
  margin-bottom: 1em;
  font-style: normal;
}

thead th {
  font-weight: normal;
  font-style: italic;
  border-bottom: 1px solid;
  text-align: left;
  margin-top: 1em;
  margin-bottom: 1em;
  padding-top: 5px;
  padding-left: 5px;
  padding-right: 5px;
  padding-bottom: 5px;
}


tbody {
  margin-top: 1em;
  margin-bottom: 1em;
  padding-top: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid;
  border-top: 1px solid;
}

td {
  padding-top: 5px;
  padding-bottom: 5px;
  padding-right: 10px;
}

tfoot {
  font-size: 0.8em;
  font-style: italic;
}
</style>
</head>
<body>

Figure 4.1 summarizes these findings. When both disposition and outcome are positive or negative, inferences are dispositional. When outcomes are mismatched, attributions are often situational.
<table><caption>Figure 4.1</caption>
<thead>
<tr>
<th class="thead1" colspan="3"><b>Attributions for events involving members of out-groups</b></th>
</tr>
<tr>
<th></th>
<th>Positive outcome</th>
<th>Negative outcome</th>
</tr>
</thead>
<tbody>
<tr>
<td>Positive disposition</td>
<td>Dispositional inference</td>
<td>Attribution – often situational</td>
</tr>
<tr>
<td>Negative disposition</td>
<td>Attribution – often situational</td>
<td>Dispositional inference</td>
</tr>
</tbody>
</table>
For behaviour of, or involving, members of the in-group, expectations of success and failure are important factors in determining what type of inference/attribution is made. If success is expected, then positive outcomes result in dispositional attributions and negative outcomes are likely to result in situational attributions. When failure is expected, positive outcomes are likely to result in situational attributions and negative results should lead to dispositional attributions. Figure 4.2 summarizes these expectations.
<table class="float-none"><caption>Figure 4.2</caption>
<thead>
<tr>
<th class="thead1" colspan="3">Attributions for events involving members of the in-group</th>
</tr>
<tr>
<th></th>
<th>Positive outcome</th>
<th>Negative outcome</th>
</tr>
</thead>
<tbody>
<tr>
<td>Expectations of success</td>
<td>Dispositional attribution</td>
<td>Situational attribution</td>
</tr>
<tr>
<td>Expectations of failure</td>
<td>Situational attribution</td>
<td>Dispositional attribution</td>
</tr>
</tbody>
</table>
While affect may be a factor in changes in group membership, it is not the primary cause. Instead, changes in group membership within a given issue domain are likely to occur due to a violation of 
</body>
</html>

  1. floated-table-leaves-gaping-hole.png353.6 kB
    table-float-blank-space

Edited by hughmcguire

dauwhe
I'm having trouble reproducing this. Does the source have p tags around the paragraphs? What's the CSS applied to p? I wonder if you're removing margin and/or padding from p using p+p, so when you get table+p you end up with some default space between those elements.

By the way, what version of Prince are you using? I'm testing on 9.0 rev2...

Dave
hughmcguire
hi dave that is very encouraging! I will investigate further. I'll post an update here later.

i'm on 9.0rev2 ...