0

I would like to format my table like this:

  • full width
  • columns wider than others can take more place (often the first col)
  • columns too large must be cropped (something like overflow: hidden)
  • last 2 columns must be narrow than others

Here is a jsFiddle to be more explicit: http://jsfiddle.net/BbNFA/

The problem I encounter here is when all texts in the same line are wider than the width of the page, then a scrollbar is showing. I would like to prevent this by hidden the overflow text.

Thanks for your help.

Bronzato
  • 9,438
  • 29
  • 120
  • 212

1 Answers1

0

Edit: See my DEMO here with colgroup.

Use table-layout property and set it to fixed like below,

table  { 
    width: 100%;
    table-layout: fixed; <-- added
}

td  {
    white-space: nowrap;
    overflow: hidden;    <-- added
}
Selvakumar Arumugam
  • 79,297
  • 15
  • 120
  • 134