3

Interesting HTML formatting

Hi all -

I've been adding HTML tables to my dashboards as they make things prettier and compact.

So I found when you have multiple HTML formula fields, you can't change the color of only 1 of them. Even though they are different fields it looks like Ninox treats them all the same as if you only have one CSS. Which I guess makes sense.

I've included a sample DB. If you add a RGB code to the RGB Code field (in xxx,xxx,xxx format) then the table colors will change. Only Table2 field has any reference to the RGB Code field.

So your last HTML field is the default CSS for all of your HTML code in the table/page.

18 replies

null
    • Rafael Sanchis
    • Rafael_Sanchis
    • 10 mths ago
    • Reported - view

    I've been adding HTML tables to my dashboards as they make things prettier and compact. 👍

    • Sean
    • 10 mths ago
    • Reported - view

    You can add a class to <thead> and then style the header by that class. I moved the color code out of the thead,tfoot style and into the class style and got an interesting result on the second data row. Looks like it mixed color with the tr:nth-child(odd) td color.

    I attached the DB.

      • Fred
      • 10 mths ago
      • Reported - view

       nice. That is a funny thing to happen. 

    • Fred
    • 10 mths ago
    • Reported - view

    To use this to your advantage, I thought you could create a field that you can use as your 'style sheet' put that at the end of your form and not display it, but the moment you set Display if to not show the new field then it stops affecting the other html fields.

    So it seems like you can use your last html field as your overall style sheet for the page.

    • Fred
    • 10 mths ago
    • Reported - view

    I spent some more time with trying to create a master style sheet for my forms. I came up with the attached example. Check out the CSS example page (yes, my real first use of a Page).

    I discovered that you can separate the style part and reference the field in your html fields thus creating a single style sheet. You can even hide this field, I created a Yes/No field to show that changing characteristics in the "style sheet" will still affect the html even with the style sheet hidden.

    I found out that trying to modify h1 or p is not very dependable. I could do background-color, but not text color or h1 text size. The most dependable way to modify text was inside a table, thus that is what you see in the example.

    I look forward to any tips and tricks that others have come up with. I am sure I've missed previously reported tips as I'm just now diving into HTML in Ninox.

    • gold_cat
    • 8 mths ago
    • Reported - view

    Dear Fred, Thank you for your help so far. I am currently learning HTML and would appreciate it if you could provide me with some additional resources, such as HTML databases or other learning materials. Thank you again for your time and support.

      • szormpas
      • 8 mths ago
      • Reported - view

         This is very informative:

      • gold_cat
      • 8 mths ago
      • Reported - view

      thanks!

    • red_kite
    • 6 mths ago
    • Reported - view

    Hi Fred. Here is my own autodidactic example für html-tables. Scrollable, fixed tablehead and -foot and interactiv für open the records. It's my pattern that I use myself. Mirko

      • gold_cat
      • 6 mths ago
      • Reported - view

       Hi. Friend, I want to copy it into my database, but it seems that clicking 'open the records' after HTML doesn't work. What's the problem? Thank you for your response.

      • red_kite
      • 6 mths ago
      • Reported - view

      It is the german version, you must translate "Nr" in "Id"  in ui.popupRecord.

      • Fred
      • 6 mths ago
      • Reported - view

      Love it. Very interesting that you can create variables for thead, tbody, tfoot and then put it all together later.

      I'm not sure what is the purpose of the first table variable on line 1. You don't seem to use it all later in your code? Was it just left over?

      • red_kite
      • 6 mths ago
      • Reported - view

       edit: i use it in line 63 for the calculation of the total price.

      • Fred
      • 6 mths ago
      • Reported - view

      I missed that.

      Also you could remove the second select in line 2:

      let table := ((select DummyTab) order by -DATUM);
      let filterTable := ((table[PREIS > 11]) order by -DATUM);
      

      Since filterTable is the same select as table with a filter. I don't know if you even need the order by in filterTable as well since it is already sorted, but maybe the filtering reorders.

      Thanks for sharing the code.

      • gold_cat
      • 6 mths ago
      • Reported - view

       Thank you. I know where the problem is.

      • Fred
      • 6 mths ago
      • Reported - view

      Please share your solution.

      • gold_cat
      • 6 mths ago
      • Reported - view

       😂 I'm still waiting for a reply from Ninox.

      • red_kite
      • 6 mths ago
      • Reported - view

      now it's optimized. Thanks.

Content aside

  • 3 Likes
  • 6 mths agoLast active
  • 18Replies
  • 458Views
  • 6 Following