I have a problem with a line break between the content of an HTML element and it's :after content. It's a sortable table and in the head of the table is a small arrow.
You can see it in this fiddle http://jsfiddle.net/ceuwob93/ or on this picture:
Obviously I don't want that line break in front of the arrow.
table {
width: 300px;
}
thead {
background-color: #ddd;
border-bottom: 1px solid #bbb;
}
th.sort-down:after {
content: '';
float: right;
margin-top: 7px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #404040 transparent;
}
You can do as suggested and give your columns fixed width, or if you want a more flexible approach, you can use positioning for your :after element.
table {
width: 300px;
}
thead {
background-color: #ddd;
border-bottom: 1px solid #bbb;
}
.sort-down {
padding-right: 1.5em;
position:relative;
}
.sort-down:after {
content: '';
position:absolute;
top:7px;
right:5px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #404040 transparent;
}
<table>
<thead>
<tr>
<th>Column 1</th>
<th class="sort-down">Problem</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Some long long long Text</td>
<td>Yes</td>
<td>Some other long long long text</td>
</tr>
</tbody>
</table>