HTML table row height
HTML & CSS Question:
I'm trying to confine my table row to one line only (5 mm height, 30 mm length). But it should stay that size, even if it doesn't fit in this space (because else 开发者_StackOverflow社区i get problems with the gradient background image size - looking horible).
How can I do that?
//GRS/Standorte/G08 Zürich Schindlerstrasse/Standortdaten/Gebäudedaten/E01/Trakt 2/Sicherheitsdokumentationen/*.* Abc
As Saar already said, you can try white-space: nowrap
to keep all text in one line. Add overflow:hidden
to prevent content growing uncontrollably to the right (You may have to insert a div
into the td
for that to work, not sure whether td
respects overflow: hidden.) It should work as long as there are no line breaks or block elements in the content.
This is never going to be a 100% foolproof solution, though. The user may have selected a larger font size, overstretching the cell even if there's only one line.
I don't know what your image looks like, but how about repeating it only horizontalle (background-repeat: repeat-x
) and filling the rest up with a background color? That usually helps.
Set "overflow" to "hidden" and define the width&height of your row
try css property
white-space: nowrap;
精彩评论