---
title: "How to Hide a table row with knockout style binding"  
description: "How to Hide a table row with knockout style binding"  
author: "Anonymous User"  
published: 2015-01-06  
updated: 2015-01-06  
canonical: https://www.mindstick.com/forum/12844/how-to-hide-a-table-row-with-knockout-style-binding  
category: "asp.net"  
tags: ["javascript", "asp.net mvc", "knockout.js"]  
reading_time: 1 minute  

---

# How to Hide a table row with knockout style binding

I want to bind the display-[style](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment) of a [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) row with [knockout.js](https://www.mindstick.com/forum/160797/conditional-html-heading-tag-based-on-variable-in-knockout-js) to a [viewmodel](https://www.mindstick.com/forum/157215/what-is-viewmodel-in-mvc) [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp). I have to use the [binding](https://www.mindstick.com/blog/146/dynamic-binding-in-c-sharp), because I want to hide or show the table row depending on other [properties](https://www.mindstick.com/articles/23331/nootropics-7-different-types-and-their-unique-properties) in my viewmodel.

**Sample [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):**

```
<tr data-bind="style: myProperty">    Test</tr>
```

**The viewModel:**

```
this.myProperty = ko.computed(() => {    return "{ display: none }";});
```

But this doesn't work. The property is entered after loading the [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page), but the table row is still displayed. Is there another way to do this or did I forgot something?

## Replies

### Reply by Anonymous User

You should use "visible" binding instead. More details here

Your example may looks like:

```
<tr data-bind="visible: myProperty">    Test</tr>
```


---

Original Source: https://www.mindstick.com/forum/12844/how-to-hide-a-table-row-with-knockout-style-binding

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
