htmloverflowhtml-tablefixed

HTML table with horizontal scrolling (first column fixed)


I have been trying to think of a way to make a table with a fixed first column (and the rest of the table with a horizontal overflow) I saw a post which had a similar question. but the fixed column bit did not seem to be resolved. Help?


Solution

  • I have a similar table styled like so:

    <table style="width:100%; table-layout:fixed">
      <tr>
        <td style="width: 150px">Hello, World!</td>
        <td>
          <div>
            <pre style="margin:0; overflow:scroll">My preformatted content</pre>
          </div>
        </td>
      </tr>
    </table>