it depends how close the tracks are to the table edge and whether you will want to get down and see the trains at eye level. Two inches of solid board above the table might hide a lot of the train.
There are two things people are discussing here- fascia, which extends from the table down and dresses up the edge of the table, and safety rail or boards which extend up from the table to either keep the trains on the table and/or prevent unwanted handling of them. For show layouts, clear acrylic makes sense, but for my home layout, I prefer something a little subtler and nicer.
My prewar display layout for home use only (under construction), will have a cream-colored painted fascia with moldings, in keeping with the look of a prewar display layout. For safety, I am coming up with something low- maybe 2-3" that will be open and look period. Probably turned posts at generous intervals (4-6") with brass rails (or possibly painted) running the distance. I have looked at putz fences but not found anything I like yet so will probably make something. The idea is to add a layer of protection against trains hitting the floor while hiding them as little as possible and preserving the period look.