I want to make an HTML/CSS leadsheet for music. I am using a HTML table
to arrange the chords just above the lyrics:
<tr>
<td>Csus4</td>
<td>G</td>
</tr>
<tr>
<td>Ly</td>
<td>rics</td>
</tr>
</table>
Output:
I want that the remaining space between "Ly" and "rics" is filled with some kind of horizontal line, so that I get something like this:
Currently, I use HTML table
s, but I don’t mind using div
s or anything else as well.
I have tried a lot using div
s and CSS, but failed so far. Thanks for any help.
2
Answers
Use a pseudo element
The problem with using
display:flex
on table cells is that if you’ve got multiple consecutive cells needing the line it will break the table structure. I suggest using an absolute positioned pseudo element with a linear gradient background to better preserve the table structure: