logo
down
shadow

Table column fixed size is not giving the desired result, why not?


Table column fixed size is not giving the desired result, why not?
. As seen on the fiddle: http://jsfiddle.net/t2fagera/
code :


Share : facebook icon twitter icon

By : user2949251
Date : November 16 2020, 06:23 AM
Any of those help If I understood you correctly, you just can add
If statement not giving desired result

If statement not giving desired result


By : user3759145
Date : March 29 2020, 07:55 AM
To fix the issue you can do I have created a Hostel class and a Room class, the Hostel class contains an ArrayList rooms, one value in this Arraylist is the Boolean available. In the Hostelclass i have created an if statement which is supposed to show any entry in the ArrayList where boolean available is true but instead it shows all values including those where available was false, but has now been changed to true. can anyone tell me where i have gone wrong. , There are a few problems:
code :
for (Room room : rooms)
{
       theString = theString + room.getRoomData() + "\n";
       if (room.available) {
           System.out.println(theString);
       }
}
preg_match_all is not giving desired result

preg_match_all is not giving desired result


By : Dev
Date : March 29 2020, 07:55 AM
I wish this helpful for you You can use custom written function and array_map.
http://php.net/manual/en/function.array-map.php
code :
//first flatten array
$array = $array[1];
array_map("passone", $array);
array_map("passtwo", $array);


function passone ($n) {
    return substr($n, 1);
}

function passtwo ($n) {
    $nx = explode(" ", $n);
    preg_match("link=\"(.*?)\"", $nx[0], $matches);
    $ret['id'] = $matches[0];
    if (!empty($nx[1]))
    {
        $times = preg_match("stat=\"(.*?)\"", $nx[1], $matches);
        if ($times != 0)
        {
        $ret['stat'] = $matches[0];
        }
    }
    return $ret;
}
Convhull() is not giving desired result.

Convhull() is not giving desired result.


By : NY NY
Date : March 29 2020, 07:55 AM
this will help Do you mean the image should contain only palm which is with white pixles, not the black pixles. If it is so then you need to crop the image by considering largest blob area as extracted by 'regionprops'. Then apply convexhull on that only.
If condition not giving the desired result

If condition not giving the desired result


By : PhanThanh
Date : March 29 2020, 07:55 AM
will be helpful for those in need You don't need a loop you can pass the sex into the function and get the correct string returned:-
code :
var myObj = [{name: "Taimoor", sex: "male", age: "Thirty One"},{name:
    "Nida", sex: "female", age: "Twenty Nine"}];

function myLooks(sex) {
  if (sex == "male") {
    return  "handsome"
  }
  else {
    return  "beautiful"
  }
}

for (i = 0; i < myObj.length; i++) {
  console.log(myObj[i].name, myObj[i].sex, myLooks(myObj[i].sex), myObj[i].age);
}
Scrollable table with fixed column fixed with equal size

Scrollable table with fixed column fixed with equal size


By : takumn
Date : March 29 2020, 07:55 AM
I hope this helps . What about using javascript to calculate and set the width of the fixed column(.fix-col) and the margin-left of the container div(.table-scroll)?
code :
var columns = document.querySelectorAll('.fix-col');
var maxWidth = 0;

/* Loop through columns to get the widest one */
for (var i = 0; i < columns.length; i++) {
  /* Get only the width, without any paddings */
  var w = parseFloat(window.getComputedStyle(columns[i]).getPropertyValue('width'));
  if (w > maxWidth) {
    maxWidth = w;
  }
}

/* Second loop to set the width */
for (var i = 0; i < columns.length; i++) {
  columns[i].style.width = maxWidth + 'px';
}

/* And finally update the margin of the wrapping div */
var paddingPlusBorder = 21;
document.querySelector('.table-scroll').style.marginLeft = maxWidth + paddingPlusBorder + 'px';
.table-main {
  border: none;
  border-right: solid 1px rgb(75, 90, 102);
  border-collapse: separate;
  border-spacing: 0;
  font: normal 13px Arial, sans-serif;
}

.table-main thead th {
  background-color: rgb(203, 220, 233);
  border: none;
  color: #336B6B;
  padding: 10px;
  text-align: left;
  text-shadow: 1px 1px 1px #fff;
  white-space: nowrap;
}

.table-main tbody td {
  border-bottom: solid 1px rgb(75, 90, 102);
  color: #333;
  padding: 10px;
  text-shadow: 1px 1px 1px #fff;
  white-space: nowrap;
}

.table {
  position: relative;
}

.table-scroll {
  overflow-x: scroll;
  overflow-y: visible;
  padding-bottom: 5px;
  width: 500px;
}

.table-main .fix-col {
  border-left: solid 1px rgb(75, 90, 102);
  border-right: solid 1px rgb(75, 90, 102);
  left: 0;
  position: absolute;
  top: auto;
}
<div class="table">
  <div class="table-scroll">
    <table class="table-main" id="my-table">
      <thead>
        <tr>
          <th class="fix-col">Name</th>
          <th>Designation</th>
          <th>Experience</th>
          <th>Technology</th>
          <th>Company</th>
          <th>Location</th>
          <th>Contact No.</th>
          <th>Address</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="fix-col">Some very long name</td>
          <td>Front End Developer</td>
          <td>5 yrs</td>
          <td>HTML,CSS</td>
          <td>Google</td>
          <td>California</td>
          <td>9876543210</td>
          <td>Google Office</td>
        </tr>
        <tr>
          <td class="fix-col">LooooooooooongNameeee</td>
          <td>Front End Developer</td>
          <td>5 yrs</td>
          <td>HTML,CSS</td>
          <td>Google</td>
          <td>California</td>
          <td>9876543210</td>
          <td>Google Office</td>
        </tr>
        <tr>
          <td class="fix-col">Bob</td>
          <td>Front End Developer</td>
          <td>5 yrs</td>
          <td>HTML,CSS</td>
          <td>Google</td>
          <td>California</td>
          <td>9876543210</td>
          <td>Google Office</td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
function getWidth(element) {
  if (getComputedStyle in window) {
    return window.getComputedStyle(element).getPropertyValue('width');
  }

  if (currentStyle in element) {
    return element.currentStyle.width;
  } 

  var defaultWidthIfNoSupport = '100px';
  return defaultWidthIfNoSupport;
}
Related Posts Related Posts :
  • Bootstrap3 - Removed container-fluid
  • Bootstrap framework not responsive for asp.net webform
  • How to align two inner divs inside outer absolute positioned div that has fixed width in which both divs have the same w
  • Div to ignore html tags
  • Prevent caching and stale content with a static web site
  • Is there a way to change the whole document with one selector in CSS?
  • why cant I click om my navigationbar links?
  • Is there a CSS/HTML way to cut multiple shapes out of the top/bottom of a div?
  • css border around multiple links/images
  • 'No data was received in the uploaded file', but file is not empty
  • How input boxes save previous entries
  • AMP carousel direction change
  • Bootstrap multiple carousel not working on thumbnails click
  • Is there a way to put a permanent space into an input field?
  • Html boxes not displaying properly
  • How can I change a variable in Jekyll _config.yml dynamically?
  • How can I prevent DIVs from overlapping a right floated image?
  • Eclipse and .tml files highlighting not working
  • Footer is not in the bottom of the window, (phonegap jquery mobile app for windows mobile)
  • How to put div over another
  • How to use glyphicons in bootstrap 3.0
  • Wordpress page links not working
  • How Do I Use CSS to Set the Color of An ALink?
  • Webpage doesn't scroll smoothly on screen
  • YouTube iframe, browser looks for file locally
  • html displaying inline image
  • Font acting differently on IE and Firefox
  • Encoding and decoding of the character references
  • An Image Button navigate to another site html/css
  • IE8 "Save Target as ..." won't display for block elements
  • Image hover transition for span - CSS
  • How to apply min and max on textarea?
  • How to draw multiple horizontal lines (Notebook Paper effect) using css?
  • Table Printing Issue: Gaps in top and Bottom Border of th Elements
  • grouping elements with div and applying stylesheet for that group
  • Click <div> to expand, then click again to shrink - Its expanding, just not shrinking
  • CSS - How can I center a <script>'s output?
  • Django's template variable gets interpreted as HTML
  • ngx datatable vertical scroll with rowheight set to auto
  • How to make input text border with CSS when it's OnFocus
  • Anyone know of a calendar web widget for my website I could use?
  • How does Bootstrap manage to use fixed positioning for navbar on iOS?
  • Centered text in fully clickable table cell
  • Compare HTML and HTML5
  • steps of creating webpage in bangla
  • css root element margin
  • What is the point of using absolute positioning in CSS?
  • Responsive solution for long URLs (that exceed the device width)
  • Divs don't collapse as they should - media queries
  • QTreeWidgetItem display html
  • Testing html/css image on local from jfiddle
  • long attribute value of HTML
  • Why my svg picture is truncated at the bottom when embedded in html
  • Display CSS: some divs fixed, some flexible (2)
  • How to append href strings with variables in html with PHP?
  • css - Why is there a big white space between text lines?
  • div image position fixed + scroll
  • Hide specific elements from html using css
  • how to align the arrow in menu item?
  • How do I create a trapezoidal button using CSS?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org