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 6697741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:29:46+00:00 2026-05-26T06:29:46+00:00

i am using datatables.net and need to have some columns with fixed width and

  • 0

i am using datatables.net and need to have some columns with fixed width and others to divide the remaning space in %

this is my code

{ "sName": "ragsoc_denom", "sWidth": "100%"},
{ "sName": "piva", "sWidth": "80px"},
{ "sName": "telefono", "sWidth": "100px"},
{ "sName": "indirizzo", "sWidth": "100px"},
{ "sName": "cap", "sWidth": "50px"},
{ "sName": "citta", "sWidth": "50px"},
{ "sName": "id", "sWidth": "70px"}

but it doesn’t work, the percentage tables take all available space and the fixed width ones get streched to minimum

  • 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-05-26T06:29:46+00:00Added an answer on May 26, 2026 at 6:29 am

    If you do not care how the remaining % is dispersed you could leave it up to datatables by setting the remaining sWidths to null.

    If you do care how the remaining % are split up can you do this dynamically at runtime by taking the total static px (in this example 450px) subtract it from the current width of the table and then use that as a guide to determine the remaining percentages for the columns.

    For example if i had a datatable that was 1000px

    1000 – 450 = 550

    I want a column which is 10% of the remaining

    550px of 1000px = 55% left so 10% of 55% = 5.5%

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datatable I'm using which has 5 columns ( http://datatables.net/ ) The
I have an ASP.NET MVC 3 app and I'm using jQuery DataTables as grid.
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I am writing this in C# using .NET 3.5. I have a System.Data.DataSet object
I have some code of ADO.NET to dynamically detect the database schema, what I
I have implimented the example: http://www.datatables.net/examples/server_side/server_side.html only to discover that this example gets all
What is considering good practice using datatables in an asp.net applications? I need to
Using .Net and Oracle 11g - I've been returning dataTables from a procedure inside
I have started using the DataTables plugin (v1.6.2) for jQuery (v1.4.2), and I would
I have a DataTable with columns typeof(string) . I am adding strings to this

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.