I'd like to have (at a minimum) the first column of my HTML table as a static column. The rest of the columns should scroll horizontally. If the table scrolls vertically, both the static column and other columns should scroll together.
In older versions of IE, you could use CSS Expressions to accomplish this. An example can be found at http://www.javascripttoolbox.com/lib/scrollingdatagrid/.
Any idea how to convert this to a HTML, CSS, and JavaScript solution (cross browser)?
This is what I came up with so far:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div style="border: 1px solid red;">
<div style="position: relative; display: block; width: 200px;">
<div style="overflow-x: auto; border: 1px solid black; width: 200px; margin-left: 120px;">
<table>
<tbody>
<tr>
<td style="left: 20px; position: absolute; top: auto;">Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
<td>Column 4</td>
<td>Column 5</td>
</tr>
<tr>
<td style="left: 20px; position: absolute; top: auto;">Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
<td>Column 4</td>
<td>Column 5</td>
</tr>
</tbody>
</table>
</div></div>
</div>
</body>
</html>