Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's possible that this might work, but it might prove to be a bit of a nuisance at some point in the future (if not immediately).</p> <pre><code>&lt;style&gt; tbody td span {display: inline-block; width: 10em; /* this is the nuisance part, as you'll have to define a particular width, and I assume -without testing- that any percent widths would be relative to the containing `&lt;td&gt;`, not the `&lt;tr&gt;` or `&lt;table&gt;` */ overflow: hidden; white-space: nowrap; } &lt;/style&gt; ... &lt;table&gt; &lt;thead&gt;...&lt;/thead&gt; &lt;tfoot&gt;...&lt;/tfoot&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span title="some text"&gt;some text&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span title="some more text"&gt;some more text&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span title="yet more text"&gt;yet more text&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>The rationale for the <code>span</code> is that, as pointed out by others, a <code>&lt;td&gt;</code> will typically expand to accommodate the content, whereas a <code>&lt;span&gt;</code> can be given -and expected to keep- a set width; the <code>overflow: hidden</code> is intended to, but might not, hide what would otherwise cause the <code>&lt;td&gt;</code> to expand.</p> <p>I'd recommend using the <code>title</code> property of the span to show the text that's present (or clipped) in the visual cell, so that the text's still available (and if you don't want/need people to see it, then why have it in the first place, I guess...).</p> <p>Also, if you define a width for the <code>td {...}</code> the td will expand (or potentially contract, but I doubt it) to fill its implied width (as I see it this seems to be <code>table-width/number-of-cells</code>), a specified table-width doesn't seem to create the same issue.</p> <p>The downside is additional markup used for presentation.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload