Jump to content

table alignment

Recommended Posts


I have a table as shown https://www.w3schools.com/code/tryit.asp?filename=FW45FU4STHOR

1.Instead of using align=center or right i need to keep the table at 60% of width of web page.

2.I want to make it inline instead of next line.

I tried with display: inline-block; but has no effect

3. i need to update dynamic data in paramter1 to 5.am getting the content changes in pro_parameter1 but how to update in my table

    <p  id="pro_parameter1"></p>
    var currentUsedFont;
    function pro_parameter1() {

      var xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) { 
    xhttp.open("GET", "pro_parameter1.txt", true);

    setInterval(pro_parameter1(), 1000);

How to do it.


How to proceed

Edited by s_avinash_s
added 3rd point

Share this post

Link to post
Share on other sites

table is a block element by default, to centre a block element it MUST have a width and use margin: 0 auto; on itself.

A table using display: inline-block; acts like centring text would by targeting its parent block element such as  div, p, h1 to h6 and using text-align: center; on those parent block elements.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...