Code Monkey home page Code Monkey logo

Comments (4)

Vertigrator avatar Vertigrator commented on September 4, 2024 1

Brilliant. Thanks for the help. :-)

from basictable.

jerrylow avatar jerrylow commented on September 4, 2024

@Vertigrator are the widths set inline or via CSS? If it's set with CSS you could override with your own CSS (which could work with inline too with !important. Alternatively I could add some events so users can create their own callback to do this.

from basictable.

Vertigrator avatar Vertigrator commented on September 4, 2024

The widths were inline, added by SharePoint automatically. So what I did was use javascript to remove all the width attributes after the page loads. I hate rich text editors that try to be smart by adding things like this that we don't want.
// Remove all the width attributes that SharePoint adds to tables $(document).ready(function ($) { $('.epa .main-content table th, .epa .main-content table td').each(function () { $(this).removeAttr("width"); }); });

from basictable.

jerrylow avatar jerrylow commented on September 4, 2024

Ah I see, yes if you have no control over that - unfortunately. BTW based on your sample from the other issue it looks like the widths are set in the style attribute rather than the width attribute. You also don't have to do a .each for jQuery as it'll apply to all instances (not vanilla js though) so you could just do:

$('.epa .main-content table th, .epa .main-content table td').css('width', '');

from basictable.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.