|
Posted by I V on 07/21/07 19:38
On Thu, 19 Jul 2007 12:12:59 +0000, Sean wrote:
> I've got a table that is wider than the window, and I was wondering if
> there is any way to setup some persistent columns and have the others
> slide "behind" them...similar to what you can do in Excel. Any
> thoughts?
You can use position: fixed , but IIRC, Internet Explorer doesn't support
it. This would work if the fixed column is the first or last in the table,
I'm not sure if it could be extended to have the persistent column in the
middle:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Scrolling/fixed table</title>
<style type="text/css" media="screen">
table {
margin-left: 4em;
}
th.fixed {
margin-left: -4em;
position: fixed;
background-color: red;
}
</style>
</head>
<table>
<tr><th class=fixed>fixed</th><th>Scrolling</th><th>Scrolling</th><th>Scrolling</th><th>Scrolling</th></tr>
<tr><th class=fixed>Title 1</th><td>data</td><td>data</td><td>data</td><td>data</td></tr>
<tr><th class=fixed>Title 2</th><td>data</td><td>data</td><td>data</td><td>data</td></tr>
<tr><th class=fixed>Title 3</th><td>data</td><td>data</td><td>data</td><td>data</td></tr>
<tr><th class=fixed>Title 4</th><td>data</td><td>data</td><td>data</td><td>data</td></tr>
<tr><th class=fixed>Title 5</th><td>data</td><td>data</td><td>data</td><td>data</td></tr>
</table>
</html>
Navigation:
[Reply to this message]
|