CSS trick: non-wrapable lines with div’s (without tables)
  
Author:

Here is the simplest CSS-style that allows to make *any* content inside *any* HTML-page element non-wrapable without using TABLE’s.

<style>
  .singleline {
      display: table;
      table-layout: fixed;
      width: 100%;
      overflow: hidden;
      white-space: nowrap;
  }
</style>

Example:

This is the 2-column table... Left column has very long line...
Twas brillig, and the slithy toves did gyre and gimble in the wabe all mimsy were the borogoves, and the mome raths outgrabe. Right column of the table

...and the same table with the "singleline" class in left column:

This is the 2-column table... Left column has very long line...
Twas brillig, and the slithy toves did gyre and gimble in the wabe all mimsy were the borogoves, and the mome raths outgrabe. Right column of the table

TagsTags:  css, div

Send by E-mailSend by E-mail   Print versionPrint version
Comments(0)

No comments yet… Be the first to leave comment on this topic!

or
You may sign in using:
Enter with Facebook Enter with Google Enter with VK