Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8841003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:36:11+00:00 2026-06-14T10:36:11+00:00

Alright, so I’ve got an ASP.NET GridView which of course generates a table .

  • 0

Alright, so I’ve got an ASP.NET GridView which of course generates a table. This table is inside of a div that has a static width of let’s say 673px. However, it doesn’t seem to matter what I do, I can’t get this table to stay within those dimensions and scroll horizontally.

Here is the HTML with the style inline:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <style>
        *
        {
            padding-top: 0px;
            padding-right: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            font-family: Arial, Helvetica, sans-serif;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
            margin-left: 0px;
        }
        html
        {
            color: #000;
            font-size: 12px;
            border-top-color: currentColor;
            border-right-color: currentColor;
            border-bottom-color: currentColor;
            border-left-color: currentColor;
            border-top-width: 0px;
            border-right-width: 0px;
            border-bottom-width: 0px;
            border-left-width: 0px;
            border-top-style: none;
            border-right-style: none;
            border-bottom-style: none;
            border-left-style: none;
        }
        body
        {
            background-color: rgb(237, 237, 237);
        }
        a
        {
            color: #154995;
            text-decoration: none;
        }
        .d-outer
        {
            width: 958px;
            text-align: left;
            margin-top: 0px;
            margin-right: auto;
            margin-bottom: 0px;
            margin-left: auto;
        }
        .d-inner
        {
            width: 958px;
            padding-top: 0px;
            padding-right: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            float: left;
            background-image: url("../images/base/inner_bg.gif");
            background-attachment: scroll;
            background-repeat: repeat-y;
            background-position-x: left;
            background-position-y: top;
            background-size: auto;
            background-origin: padding-box;
            background-clip: border-box;
            background-color: transparent;
        }
        .d-innerCont
        {
            width: 908px;
            padding-top: 10px;
            padding-right: 25px;
            padding-bottom: 15px;
            padding-left: 25px;
            float: left;
        }
        .d-main
        {
            width: 908px;
            padding-top: 0px;
            padding-right: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            float: left;
        }
        .d-left
        {
            width: 665px;
            padding-top: 0px;
            padding-right: 23px;
            padding-bottom: 0px;
            padding-left: 10px;
            float: left;
        }
        .gridViewStyle
        {
            width: 630px;
            overflow: scroll;
        }
        .gridViewStyle th, .gridViewStyle td
        {
            padding-top: 5px;
            padding-right: 5px;
            padding-bottom: 5px;
            padding-left: 5px;
        }
        .d-dataGridCont
        {
            width: 665px;
            padding-top: 0px;
            float: left;
        }
        .d-dataGridBody
        {
            width: 665px;
            padding-top: 0px;
            padding-right: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            float: left;
            background-image: url("../images/base/data_grid_bg.gif");
            background-attachment: scroll;
            background-repeat: repeat-y;
            background-position-x: left;
            background-position-y: top;
            background-size: auto;
            background-origin: padding-box;
            background-clip: border-box;
            background-color: transparent;
        }
        .d-dataGridBodyRow
        {
            width: 637px;
            padding-top: 0px;
            padding-right: 14px;
            padding-bottom: 0px;
            padding-left: 14px;
            float: left;
        }
    </style>
</head>
<body>
    <form name="aspnetForm" id="aspnetForm" onsubmit="javascript:return WebForm_OnSubmit();"
    method="post">
    <div class="d-outer">
        <div class="d-inner">
            <div class="d-innerCont">
                <div class="d-main">
                    <div class="d-left">
                        <div class="d-dataGridCont">
                            <div class="d-dataGridBody">
                                <div class="d-dataGridBodyRow">
                                    <div id="ctl00_formContent_PaymentsDiv">
                                        <div>
                                            <table class="gridViewStyle" id="ctl00_formContent_grdPayments" style="width: 95%;
                                                color: #333333; font-family: Lato; border-top-color: #c8c8c8; border-right-color: #c8c8c8;
                                                border-bottom-color: #c8c8c8; border-left-color: #c8c8c8; border-top-width: 2px;
                                                border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-style: solid;
                                                border-right-style: solid; border-bottom-style: solid; border-left-style: solid;
                                                border-collapse: collapse;" border="0" cellspacing="0">
                                                <tbody style="">
                                                    <tr align="center" style="color: white; background-color: rgb(36, 97, 191);">
                                                        <td colspan="6">
                                                            <table border="0">
                                                                <tbody>
                                                                    <tr>
                                                                        <td>
                                                                            <span>1</span>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$2')">
                                                                                2</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$3')">
                                                                                3</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$4')">
                                                                                4</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$5')">
                                                                                5</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$6')">
                                                                                6</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$7')">
                                                                                7</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$8')">
                                                                                8</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$9')">
                                                                                9</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$10')">
                                                                                10</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$11')">
                                                                                ...</a>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr style="color: #333333; font-size: 18px; font-weight: bold; white-space: nowrap;
                                                        background-color: white;">
                                                        <th scope="col">
                                                            Issued Date
                                                        </th>
                                                        <th scope="col">
                                                            Customer
                                                        </th>
                                                        <th scope="col">
                                                            Vehicle Type
                                                        </th>
                                                        <th scope="col">
                                                            Claim #
                                                        </th>
                                                        <th scope="col">
                                                            Amount
                                                        </th>
                                                        <th scope="col">
                                                            Status
                                                        </th>
                                                    </tr>
                                                    <tr style="font-family: Lato; font-size: 16px; white-space: nowrap; background-color: rgb(226, 237, 243);">
                                                        <td>
                                                            2012/11/12
                                                        </td>
                                                        <td>
                                                            Bob's Repair
                                                        </td>
                                                        <td>
                                                            1999 Chevrolet Lumina
                                                        </td>
                                                        <td>
                                                            4687426946874269
                                                        </td>
                                                        <td align="right">
                                                            $409,714.00
                                                        </td>
                                                        <td>
                                                            ISSUED
                                                        </td>
                                                    </tr>
                                                    <tr align="center" style="color: white; background-color: rgb(36, 97, 191);">
                                                        <td colspan="6">
                                                            <table border="0">
                                                                <tbody>
                                                                    <tr>
                                                                        <td>
                                                                            <span>1</span>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$2')">
                                                                                2</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$3')">
                                                                                3</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$4')">
                                                                                4</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$5')">
                                                                                5</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$6')">
                                                                                6</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$7')">
                                                                                7</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$8')">
                                                                                8</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$9')">
                                                                                9</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$10')">
                                                                                10</a>
                                                                        </td>
                                                                        <td>
                                                                            <a style="color: white;" href="javascript:__doPostBack('ctl00$formContent$grdPayments','Page$11')">
                                                                                ...</a>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>

What I need to get in the end is the table to adhere to the static width of its container and scroll both the header and row data horizontally.

I thank you all for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:36:13+00:00Added an answer on June 14, 2026 at 10:36 am

    Put overflow:auto; in the .d-dataGridBody

           .d-dataGridBody
            {
                width: 665px;
                padding-top: 0px;
                padding-right: 0px;
                padding-bottom: 0px;
                padding-left: 0px;
                float: left;
                background-image: url("../images/base/data_grid_bg.gif");
                background-attachment: scroll;
                background-repeat: repeat-y;
                background-position-x: left;
                background-position-y: top;
                background-size: auto;
                background-origin: padding-box;
                background-clip: border-box;
                background-color: transparent;
                overflow:auto;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I understand that this problem has been asked a lot of times at
Alright, so I got this code for gluLookAt: lookAt = new Vector3f(-player.pos.x, -player.pos.y, -player.pos.z);
Alright so this is a bizarre cross platform thing that I'm experiencing with text
Alright it has come to this. I searched this website among many others and
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I'm about 90% sure that this isn't possible, but I thought I'd
Alright, this one's got me seriously stumped, after trying things out for hours with
Alright, I am trying to accomplish this: When a user clicks a button that
Alright, I found out in this question that polling sockets does not scale, so
Alright I don't see why this isnt working. It seems pretty simple. Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.