Reputation: 33867
I am creating an HTML report (it's to be a form for filling in). I have a table at the bottom of the form which contains a list of items and yes/no checkboxes at the side. I need to have this work so that cells on the left that contain a question have any empty space filled with dots, e.g.:
Short question......................... yes no
Longer question etc, etc............... yes no
Does anyone know of a way of doing this, ideally by CSS, but on the server side if necessary.
Upvotes: 2
Views: 6463
Reputation: 93493
You can do this all in CSS...
td div
{
width: 20em;
overflow: hidden;
white-space: nowrap;
}
td div:after
{
content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "
}
but you've got to:
<td><div>Cell contents</div></td>
For a truly flexible, cross-browser approach that doesn't require fixed cell widths, you will need to use jQuery for now. (But please start a new question for that.)
Upvotes: 0
Reputation: 9413
you can use tables. overflow: hidden will make dots after 150px dissapear and you will have dot fill of different length for different rows
<table>
<tr>
<td style="width: 150px; overflow: hidden;">
Short question........................................................
</td>
<td>
yes no
</td>
</tr>
</table>
Upvotes: 2
Reputation: 26227
I did this once by using a single GIF image which was repeated on the X axis as the background of the table cells. It worked out pretty nicely, actually. So the GIF image was basically just a single black pixel with some transparent pixels around it.
But then you also have to add a <span>
around the actual text of the table cells and let the span have a white background to prevent the black dots from showing underneath.
Upvotes: 5