Solved

Need top n rows in an html table fixed

Posted on 2012-04-09
4
243 Views
Last Modified: 2012-04-10
Need top n rows in an html table fixed so they are always visible when I scroll down a table
0
Comment
Question by:robrodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37824248
0
 

Author Comment

by:robrodp
ID: 37824541
Either they are too complicated or dont work across browsers.

Somebody must have a simple and elegant solution. Just plain HTML5, no plugings etc
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37824641
On another question, the only 'complete' working solution was to use two tables and make sure the <td> widths were identical on both tables.  The top or 'header' table was just a single row.  The bottom table was set to scroll.
0
 
LVL 12

Expert Comment

by:Anuradha Goli
ID: 37827427
Create two tables one with fixed rows and other with scrollable height.
<html>
<head>
    <title></title>
</head>
<body>
    <table style="width: 300px" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                Column 1
            </td>
            <td>
                Column 2
            </td>
        </tr>
    </table>
    <div style="overflow: auto; height: 100px; width: 320px;">
        <table style="width: 300px;" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
            <tr>
                <td>
                    Value 1
                </td>
                <td>
                    Value 2
                </td>
            </tr>
        </table>
    </div>
</body>
</html>

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filktering Alphabetically 8 42
Navigation Menu Does Not Show on iPad 4 31
What cart is this? 2 35
Why is my $_POST not going to results page 10 38
Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question